PsppireValueEntry: Use a more reliable way to override parent property.
[pspp] / src / ui / gui / helper.c
index 7fc951d3cdeff0a7252bc3cb4de5f1a1ae79effe..c7cfaebe8df57e334f93fbb82e14a576a64ec557 100644 (file)
@@ -40,7 +40,6 @@
 #include <data/settings.h>
 
 #include "psppire-data-store.h"
-#include "psppire.h"
 
 #include "gl/configmake.h"
 #include "xalloc.h"
@@ -156,7 +155,14 @@ text_to_value__ (const gchar *text,
     }
 
   value_init (val, width);
-  free (data_in (ss_cstr (text), UTF8, format->type, val, width, encoding));
+  char *err = data_in (ss_cstr (text), UTF8, format->type, val, width, encoding);
+
+  if (err)
+    {
+      value_destroy (val, width);
+      val = NULL;
+      free (err);
+    }
 
   return val;
 }
@@ -283,7 +289,7 @@ clone_list_store (const GtkListStore *src)
 
 
 
-static gboolean 
+static gboolean
 on_delete (GtkWindow *window, GdkEvent *e, GtkWindow **addr)
 {
   *addr = NULL;