[gimp] app: ref/unref the context in gimp_image_editor_set_context()



commit 11ac0296b963c06fc8dac72793bd751a2f348476
Author: Michael Natterer <mitch gimp org>
Date:   Sun Feb 6 00:59:52 2011 +0100

    app: ref/unref the context in gimp_image_editor_set_context()

 app/widgets/gimpimageeditor.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/app/widgets/gimpimageeditor.c b/app/widgets/gimpimageeditor.c
index 4f6bb9e..a707f39 100644
--- a/app/widgets/gimpimageeditor.c
+++ b/app/widgets/gimpimageeditor.c
@@ -83,14 +83,20 @@ gimp_image_editor_set_context (GimpDocked  *docked,
   GimpImage       *image  = NULL;
 
   if (editor->context)
-    g_signal_handlers_disconnect_by_func (editor->context,
-                                          gimp_image_editor_set_image,
-                                          editor);
+    {
+      g_signal_handlers_disconnect_by_func (editor->context,
+                                            gimp_image_editor_set_image,
+                                            editor);
+
+      g_object_unref (editor->context);
+    }
 
   editor->context = context;
 
   if (context)
     {
+      g_object_ref (editor->context);
+
       g_signal_connect_swapped (context, "image-changed",
                                 G_CALLBACK (gimp_image_editor_set_image),
                                 editor);



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