Revert "Fix crash in gui, when T-TEST or ONEWAY while a filter is set."
[pspp] / src / data / dictionary.c
index 40352b0f2ba9e97708fb21c8aec422c75dddb4b7..2c35dcf4e6cc83424068867efa2fd4958c9b2044 100644 (file)
@@ -186,13 +186,6 @@ dict_create (const char *encoding)
   return d;
 }
 
-struct dictionary *
-dict_ref (struct dictionary *s)
-{
-  s->ref_cnt++;
-  return s;
-}
-
 /* Creates and returns a (deep) copy of an existing
    dictionary.
 
@@ -314,6 +307,13 @@ _dict_destroy (struct dictionary *d)
   free (d);
 }
 
+struct dictionary *
+dict_ref (struct dictionary *d)
+{
+  d->ref_cnt++;
+  return d;
+}
+
 void
 dict_unref (struct dictionary *d)
 {
@@ -1172,22 +1172,6 @@ dict_set_filter (struct dictionary *d, struct variable *v)
   assert (v == NULL || dict_contains_var (d, v));
   assert (v == NULL || var_is_numeric (v));
 
-  /* When a filter is set, we ref the dictionary.
-     This is because the GUI maintains a pointer
-     to the dict's variables, and the variables'
-     addresses change in the callback.  */
-  if (d->filter == NULL && v != NULL)
-    {
-      d = dict_ref (d);
-    }
-
-  /* Deref the dict when a filter is removed.  */
-  if (d->filter != NULL && v == NULL)
-    {
-      assert (d->ref_cnt > 0);
-      dict_unref (d);
-    }
-
   d->filter = v;
 
   if (d->changed) d->changed (d, d->changed_data);