[anjuta] libanjuta: keep a ref on the AnjutaAsyncCommand when its thread is run



commit ccef579ddf0015347f4b376a4bd7447ca65ad872
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Tue Feb 19 08:57:08 2013 +0100

    libanjuta: keep a ref on the AnjutaAsyncCommand when its thread is run
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694194

 libanjuta/anjuta-async-command.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libanjuta/anjuta-async-command.c b/libanjuta/anjuta-async-command.c
index bdd2613..e39fcd5 100644
--- a/libanjuta/anjuta-async-command.c
+++ b/libanjuta/anjuta-async-command.c
@@ -120,6 +120,8 @@ anjuta_async_command_thread (AnjutaCommand *command)
        
        return_code = ANJUTA_COMMAND_GET_CLASS (command)->run (command);
        anjuta_command_notify_complete (command, return_code);
+
+       g_object_unref (command);
        return NULL;
 }
 
@@ -129,7 +131,7 @@ start_command (AnjutaCommand *command)
        g_idle_add ((GSourceFunc) anjuta_async_command_notification_poll, 
                                command);
        g_thread_new ("AnjutaCommand Thread",
-                     (GThreadFunc) anjuta_async_command_thread, command);
+                     (GThreadFunc) anjuta_async_command_thread, g_object_ref (command));
 }
 
 static void


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