From 9b18c84ccde2ff7231baddab7dd53403fc4df2d9 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 21 Jun 2012 12:42:52 +0200 Subject: 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 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libempathy/empathy-ft-factory.c') diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c index 10c8bea08..2c213b050 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)); } /** -- cgit v1.2.3