/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2017 Free Software Foundation
+ Copyright (C) 2009, 2010, 2011, 2012, 2013, 2017,
+ 2020 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GtkTreeIter *b,
gpointer user_data)
{
- const struct variable *var_a;
- const struct variable *var_b;
-
+ struct variable *var_a;
+ struct variable *var_b;
gtk_tree_model_get (model, a, DICT_TVM_COL_VAR, &var_a, -1);
gtk_tree_model_get (model, b, DICT_TVM_COL_VAR, &var_b, -1);
- return compare_var_ptrs_by_dict_index (&var_a, &var_b, NULL);
+ gint rval = compare_var_ptrs_by_dict_index (&var_a, &var_b, NULL);
+
+ var_unref (var_a);
+ var_unref (var_b);
+
+ return rval;
}
static gint
GtkTreeIter *b,
gpointer user_data)
{
- const struct variable *var_a;
- const struct variable *var_b;
+ struct variable *var_a;
+ struct variable *var_b;
gtk_tree_model_get (model, a, DICT_TVM_COL_VAR, &var_a, -1);
gtk_tree_model_get (model, b, DICT_TVM_COL_VAR, &var_b, -1);
- return g_strcmp0 (var_get_name (var_a), var_get_name (var_b));
+ gint rval = g_strcmp0 (var_get_name (var_a), var_get_name (var_b));
+
+ var_unref (var_a);
+ var_unref (var_b);
+
+ return rval;
}
GtkTreeIter *b,
gpointer user_data)
{
- const struct variable *var_a;
- const struct variable *var_b;
+ struct variable *var_a;
+ struct variable *var_b;
gtk_tree_model_get (model, a, DICT_TVM_COL_VAR, &var_a, -1);
gtk_tree_model_get (model, b, DICT_TVM_COL_VAR, &var_b, -1);
- return g_strcmp0 (var_get_label (var_a), var_get_label (var_b));
+ gint rval = g_strcmp0 (var_get_label (var_a), var_get_label (var_b));
+
+ var_unref (var_a);
+ var_unref (var_b);
+
+ return rval;
}
{
g_object_set (cell, "text", var_get_name (var), NULL);
}
+
+ var_unref (var);
}
"icon-name", get_var_measurement_stock_id (var_get_print_format (var)->type,
var_get_measure (var)),
NULL);
+
+ var_unref (var);
}
const char *
if (!ok)
return FALSE;
-
gtk_tree_model_get (tree_model, &iter, DICT_TVM_COL_VAR, &var, -1);
if (! var_has_label (var))
- return FALSE;
+ {
+ var_unref (var);
+ return FALSE;
+ }
{
const gchar *tip ;
gtk_tooltip_set_text (tooltip, tip);
}
+ var_unref (var);
return TRUE;
}
else
return NULL;
}
-
-