[at-spi2-core] Unref process_deferred_messages_source when clearing it



commit f79c276c80e8ac1335c99688e40b67e88ea325dc
Author: Mike Gorse <mgorse suse com>
Date:   Wed Oct 9 16:22:17 2013 -0500

    Unref process_deferred_messages_source when clearing it
    
    Since g_source_attach adds a ref to a source and we keep the source stored
    in a global variable and, therefore, do not unref it after attaching it, we
    thus need to unref it when it is being destroyed and we clear the global
    variable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709625

 atspi/atspi-misc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 6eece9d..2da473c 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -746,6 +746,7 @@ process_deferred_messages_callback (gpointer data)
   if (process_deferred_messages ())
     return G_SOURCE_CONTINUE;
 
+  g_source_unref (process_deferred_messages_source);
   process_deferred_messages_source = NULL;
   return G_SOURCE_REMOVE;
 }
@@ -1606,6 +1607,7 @@ atspi_set_main_context (GMainContext *cnx)
   if (process_deferred_messages_source != NULL)
   {
     g_source_destroy (process_deferred_messages_source);
+    g_source_unref (process_deferred_messages_source);
     process_deferred_messages_source = g_idle_source_new ();
     g_source_set_callback (process_deferred_messages_source,
                            process_deferred_messages_callback, NULL, NULL);


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