From a16ae567635169e8a0f6e7eae037728c88ed17fe Mon Sep 17 00:00:00 2001
From: John Darrington <john@darrington.wattle.id.au>
Date: Sat, 27 Jun 2020 09:19:27 +0200
Subject: [PATCH] Revert "Fix crash in gui, when T-TEST or ONEWAY while a
 filter is set."

This reverts commit d01a4986ffc8f5afa5ee7d29dd7233143b6de7ec
which caused memory leaks.
---
 NEWS                  |  3 ---
 src/data/dictionary.c | 16 ----------------
 2 files changed, 19 deletions(-)

diff --git a/NEWS b/NEWS
index 9e4c345fb2..f5fa4355fe 100644
--- 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.
 
diff --git a/src/data/dictionary.c b/src/data/dictionary.c
index a04fcaed44..2c35dcf4e6 100644
--- a/src/data/dictionary.c
+++ b/src/data/dictionary.c
@@ -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);
-- 
2.30.2