[empathy/gnome-3-4] ft-factory: ensure that the factory stays alive while empathy_ft_handler_new_outgoing() is running



commit 7ce9e8f152149e8365ea48201b00019a34e11c64
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Jun 21 12:42:52 2012 +0200

    ft-factory: ensure that the factory stays alive while empathy_ft_handler_new_outgoing() is running
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678524

 libempathy/empathy-ft-factory.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c
index 10c8bea..2c213b0 100644
--- a/libempathy/empathy-ft-factory.c
+++ b/libempathy/empathy-ft-factory.c
@@ -225,9 +225,11 @@ ft_handler_outgoing_ready_cb (EmpathyFTHandler *handler,
     GError *error,
     gpointer user_data)
 {
-  EmpathyFTFactory *factory = user_data;
+  EmpathyFTFactory *factory = EMPATHY_FT_FACTORY (user_data);
 
   g_signal_emit (factory, signals[NEW_FT_HANDLER], 0, handler, error);
+
+  g_object_unref (factory);
 }
 
 /* public methods */
@@ -266,7 +268,7 @@ empathy_ft_factory_new_transfer_outgoing (EmpathyFTFactory *factory,
   g_return_if_fail (G_IS_FILE (source));
 
   empathy_ft_handler_new_outgoing (contact, source, action_time,
-      ft_handler_outgoing_ready_cb, factory);
+      ft_handler_outgoing_ready_cb, g_object_ref (factory));
 }
 
 /**



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