X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-ptr.c;h=a5511ec31fc0f7848374a1ca59a1a6e376859801;hb=e0cbdf0daefcca81be9572aab0deedf945687f5a;hp=52eb3e4dbce587496f9c772553d1b7bc6ef6a909;hpb=ab74a869bc2ee9f6b50565f47459d42445705204;p=pspp diff --git a/src/ui/gui/psppire-var-ptr.c b/src/ui/gui/psppire-var-ptr.c index 52eb3e4dbc..a5511ec31f 100644 --- a/src/ui/gui/psppire-var-ptr.c +++ b/src/ui/gui/psppire-var-ptr.c @@ -28,17 +28,17 @@ */ -/* Shallow copy the pointer */ static gpointer variable_copy (gpointer var) { - return var; + struct variable *v = var; + return var_ref (v); } -/* Do nothing. It's a pointer only! */ static void variable_free (gpointer var) { + var_unref (var); } @@ -49,7 +49,7 @@ variable_to_string (const GValue *src, { const struct variable *v = g_value_get_boxed (src); - if ( v == NULL) + if (v == NULL) g_value_set_string (dest, ""); else g_value_set_string (dest, var_get_name (v)); @@ -63,7 +63,7 @@ variable_to_int (const GValue *src, { const struct variable *v = g_value_get_boxed (src); - if ( v == NULL) + if (v == NULL) g_value_set_int (dest, -1); else g_value_set_int (dest, var_get_dict_index (v)); @@ -77,7 +77,7 @@ psppire_var_ptr_get_type (void) { static GType t = 0; - if (t == 0 ) + if (t == 0) { t = g_boxed_type_register_static ("psppire-var-ptr", (GBoxedCopyFunc) variable_copy,