X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-indep-samps.c;h=f0995e92e85befe5918b06db37371519a08812d7;hb=2c4b104df57f2e8b5ed2afa50819294aaac4aa6c;hp=faea2b41414975e1bf0519c4614e3de0bdb7fcd9;hpb=96994a54e60e9c95b8bba54c2281acf7059b1203;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-indep-samps.c b/src/ui/gui/psppire-dialog-action-indep-samps.c index faea2b4141..f0995e92e8 100644 --- a/src/ui/gui/psppire-dialog-action-indep-samps.c +++ b/src/ui/gui/psppire-dialog-action-indep-samps.c @@ -74,6 +74,7 @@ refresh (PsppireDialogAction *da) value_destroy (&act->cut_point, width); value_destroy (&act->grp_val[0], width); value_destroy (&act->grp_val[1], width); + var_unref (act->grp_var); act->grp_var = NULL; act->grp_var_width = -1; } @@ -243,7 +244,7 @@ on_grp_var_change (GtkEntry *entry, PsppireDialogActionIndepSamps *act) PsppireDialogAction *da = PSPPIRE_DIALOG_ACTION (act); const gchar *text = gtk_entry_get_text (entry); - const struct variable *v = da->dict ? psppire_dict_lookup_var (da->dict, text) : NULL; + struct variable *v = da->dict ? psppire_dict_lookup_var (da->dict, text) : NULL; gtk_widget_set_sensitive (act->define_groups_button, v != NULL); @@ -276,7 +277,11 @@ on_grp_var_change (GtkEntry *entry, PsppireDialogActionIndepSamps *act) } } - act->grp_var = v; + struct variable *old_grp_var = act->grp_var; + if (v) + act->grp_var = var_ref (v); + if (old_grp_var) + var_unref (old_grp_var); act->grp_var_width = v ? var_get_width (v) : -1; }