[gimp] app: disconnect symmetries' callbacks connected to image signals...



commit f713c86d9f182e577dd1c4b2f0ae165727d03a49
Author: Jehan <jehan girinstud io>
Date:   Tue Jun 28 19:25:42 2016 +0200

    app: disconnect symmetries' callbacks connected to image signals...
    
    ... on symmetry destruction.
    Use g_signal_connect_object() which does this automatically.

 app/core/gimpsymmetry-mandala.c |   10 +++-------
 app/core/gimpsymmetry-mirror.c  |    6 +++---
 app/core/gimpsymmetry-tiling.c  |    6 +++---
 3 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/app/core/gimpsymmetry-mandala.c b/app/core/gimpsymmetry-mandala.c
index d7e471b..e33791c 100644
--- a/app/core/gimpsymmetry-mandala.c
+++ b/app/core/gimpsymmetry-mandala.c
@@ -167,20 +167,16 @@ gimp_mandala_constructed (GObject *object)
   g_object_set_data_full (object, "center-x:max", x_max, g_free);
   g_object_set_data_full (object, "center-y:max", y_max, g_free);
 
-  g_signal_connect (sym->image, "size-changed-detailed",
-                    G_CALLBACK (gimp_mandala_image_size_changed_cb),
-                    sym);
+  g_signal_connect_object (sym->image, "size-changed-detailed",
+                           G_CALLBACK (gimp_mandala_image_size_changed_cb),
+                           sym, 0);
 }
 
 static void
 gimp_mandala_finalize (GObject *object)
 {
-  GimpSymmetry *sym     = GIMP_SYMMETRY (object);
   GimpMandala  *mandala = GIMP_MANDALA (object);
 
-  g_signal_handlers_disconnect_by_func (sym->image,
-                                        gimp_mandala_image_size_changed_cb,
-                                        object);
   if (mandala->horizontal_guide)
     g_object_unref (mandala->horizontal_guide);
   mandala->horizontal_guide = NULL;
diff --git a/app/core/gimpsymmetry-mirror.c b/app/core/gimpsymmetry-mirror.c
index c36e975..16e2eda 100644
--- a/app/core/gimpsymmetry-mirror.c
+++ b/app/core/gimpsymmetry-mirror.c
@@ -193,9 +193,9 @@ gimp_mirror_constructed (GObject *object)
   g_object_set_data_full (object, "horizontal-position:max", y_max, g_free);
   g_object_set_data_full (object, "vertical-position:max", x_max, g_free);
 
-  g_signal_connect (sym->image, "size-changed-detailed",
-                    G_CALLBACK (gimp_mirror_image_size_changed_cb),
-                    sym);
+  g_signal_connect_object (sym->image, "size-changed-detailed",
+                           G_CALLBACK (gimp_mirror_image_size_changed_cb),
+                           sym, 0);
 }
 
 static void
diff --git a/app/core/gimpsymmetry-tiling.c b/app/core/gimpsymmetry-tiling.c
index a5328a7..6d1014d 100644
--- a/app/core/gimpsymmetry-tiling.c
+++ b/app/core/gimpsymmetry-tiling.c
@@ -165,9 +165,9 @@ gimp_tiling_constructed (GObject *object)
   g_object_set_data_full (object, "y-interval:max", y_max, g_free);
   g_object_set_data_full (object, "shift:max", shift_max, g_free);
 
-  g_signal_connect (sym->image, "size-changed-detailed",
-                    G_CALLBACK (gimp_tiling_image_size_changed_cb),
-                    sym);
+  g_signal_connect_object (sym->image, "size-changed-detailed",
+                           G_CALLBACK (gimp_tiling_image_size_changed_cb),
+                           sym, 0);
 
   /* Set reasonable defaults. */
   tiling->interval_x = gimp_image_get_width (sym->image) / 2;


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