Audit and cleanup dispose methods of classes which have them.
[pspp] / src / ui / gui / psppire-dict.c
index 87d13bc6e4d8db45468ad7c6e81055718c2b0a0c..e381e5dab7a40050df1a47f89e33564ded7341f6 100644 (file)
@@ -287,6 +287,11 @@ psppire_dict_dispose (GObject *object)
 {
   PsppireDict *d = PSPPIRE_DICT (object);
 
+  if (!d->dispose_has_run)
+    return;
+
+  d->dispose_has_run = TRUE;
+
   dict_set_callbacks (d->dict, NULL, NULL);
   dict_unref (d->dict);
 
@@ -352,10 +357,12 @@ static const struct dict_callbacks gui_callbacks =
   };
 
 static void
-psppire_dict_init (PsppireDict *psppire_dict)
+psppire_dict_init (PsppireDict *d)
 {
-  psppire_dict->stamp = g_random_int ();
-  psppire_dict->disable_insert_signal = FALSE;
+  d->dispose_has_run = FALSE;
+
+  d->stamp = g_random_int ();
+  d->disable_insert_signal = FALSE;
 }
 
 /**