Revert "Fix crash in gui, when T-TEST or ONEWAY while a filter is set."
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 27 Jun 2020 07:19:27 +0000 (09:19 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 27 Jun 2020 07:19:27 +0000 (09:19 +0200)
This reverts commit d01a4986ffc8f5afa5ee7d29dd7233143b6de7ec
which caused memory leaks.

NEWS
src/data/dictionary.c

diff --git a/NEWS b/NEWS
index 9e4c345fb2f156b12a11d0d1dd4f6ed07971fd25..f5fa4355fe0a103035e0781da7df6177336d6ae0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -60,9 +60,6 @@ Changes from 1.2.0 to 1.3.0:
 
  * The MEANS command has been re-implemented.
 
- * A bug where the GUI would crash when T-TEST was executed whilst
-   a filter was set has been fixed.
-
  * The GUI now has a sub-dialog for post-hoc tests of the oneway
    anova test.
 
index a04fcaed447c393e5df6960e8295eef9121dbff6..2c35dcf4e6cc83424068867efa2fd4958c9b2044 100644 (file)
@@ -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);