[Xfce4-commits] <tumbler:jannis/specialized> Fix wrong unref in TumblerService. Disconnect from schedulers properly.

Jannis Pohlmann noreply at xfce.org
Wed Nov 11 01:52:02 CET 2009


Updating branch refs/heads/jannis/specialized
         to 2e01b60274a3efd34fe9ebe2e373c11dad06e53a (commit)
       from 3ba728e30d5c104789015c747ced6014734919af (commit)

commit 2e01b60274a3efd34fe9ebe2e373c11dad06e53a
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Wed Nov 11 01:46:58 2009 +0100

    Fix wrong unref in TumblerService. Disconnect from schedulers properly.

 tumblerd/tumbler-service.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/tumblerd/tumbler-service.c b/tumblerd/tumbler-service.c
index ad1644f..69e8e40 100644
--- a/tumblerd/tumbler-service.c
+++ b/tumblerd/tumbler-service.c
@@ -246,6 +246,20 @@ tumbler_service_add_scheduler (TumblerService   *service,
 
 
 static void
+tumbler_service_remove_scheduler (TumblerScheduler *scheduler,
+                                  TumblerService   *service)
+{
+  g_return_if_fail (TUMBLER_IS_SCHEDULER (scheduler));
+  g_return_if_fail (TUMBLER_IS_SERVICE (service));
+
+  g_signal_handlers_disconnect_matched (scheduler, G_SIGNAL_MATCH_DATA,
+                                        0, 0, NULL, NULL, service);
+  g_object_unref (scheduler);
+}
+
+
+
+static void
 tumbler_service_constructed (GObject *object)
 {
   TumblerService   *service = TUMBLER_SERVICE (object);
@@ -281,7 +295,7 @@ tumbler_service_finalize (GObject *object)
   g_object_unref (service->volume_monitor);
 
   /* release all schedulers and the scheduler list */
-  g_list_foreach (service->schedulers, (GFunc) g_object_unref, NULL);
+  g_list_foreach (service->schedulers, (GFunc) tumbler_service_remove_scheduler, service);
   g_list_free (service->schedulers);
 
   /* release the reference on the thumbnailer registry */



More information about the Xfce4-commits mailing list