[gnome-builder] source-view: fix free of command_str



commit 42a1ba32e0db4e5d45f37eb1b80c68591a857a63
Author: Christian Hergert <chergert redhat com>
Date:   Thu Oct 13 19:42:17 2016 -0700

    source-view: fix free of command_str
    
    g_string_free requires TRUE, so we can't use g_clear_pointer here.

 libide/sourceview/ide-source-view.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/libide/sourceview/ide-source-view.c b/libide/sourceview/ide-source-view.c
index 9bc25ae..b3733bb 100644
--- a/libide/sourceview/ide-source-view.c
+++ b/libide/sourceview/ide-source-view.c
@@ -5557,7 +5557,11 @@ ide_source_view_dispose (GObject *object)
   g_clear_object (&priv->buffer_signals);
   g_clear_object (&priv->file_setting_bindings);
 
-  g_clear_pointer (&priv->command_str, g_string_free);
+  if (priv->command_str != NULL)
+    {
+      g_string_free (priv->command_str, TRUE);
+      priv->command_str = NULL;
+    }
 
   G_OBJECT_CLASS (ide_source_view_parent_class)->dispose (object);
 }
@@ -5575,12 +5579,6 @@ ide_source_view_finalize (GObject *object)
   g_clear_pointer (&priv->snippets, g_queue_free);
   g_clear_pointer (&priv->include_regex, g_regex_unref);
 
-  if (priv->command_str != NULL)
-    {
-      g_string_free (priv->command_str, TRUE);
-      priv->command_str = NULL;
-    }
-
   EGG_COUNTER_DEC (instances);
 
   G_OBJECT_CLASS (ide_source_view_parent_class)->finalize (object);


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