[libgda] gdaui-entry-wrapper: fix segfault



commit a631cc2082fee5085481e475dba7518e319e2dbe
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Sep 21 17:27:49 2018 -0500

    gdaui-entry-wrapper: fix segfault

 libgda-ui/data-entries/gdaui-entry-wrapper.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-wrapper.c b/libgda-ui/data-entries/gdaui-entry-wrapper.c
index 125c56e2b..07460ad1d 100644
--- a/libgda-ui/data-entries/gdaui-entry-wrapper.c
+++ b/libgda-ui/data-entries/gdaui-entry-wrapper.c
@@ -245,11 +245,14 @@ gdaui_entry_wrapper_dispose (GObject *object)
        wrapper = GDAUI_ENTRY_WRAPPER (object);
        GdauiEntryWrapperPrivate *priv = gdaui_entry_wrapper_get_instance_private (wrapper);
 
-               if (priv->value_ref)
-                       gda_value_free (priv->value_ref);
-               if (priv->value_default)
-                       gda_value_free (priv->value_default);
-
+       if (priv->value_ref) {
+               gda_value_free (priv->value_ref);
+               priv->value_ref = NULL;
+       }
+       if (priv->value_default) {
+               gda_value_free (priv->value_default);
+               priv->value_default = NULL;
+       }
 
        /* for the parent class */
        G_OBJECT_CLASS (gdaui_entry_wrapper_parent_class)->dispose (object);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]