[hotssh] gssh: Hold ref before destroying state



commit 8b2f11d48f0ca36ee2167cdc772fa2f1c5f24bb0
Author: Colin Walters <walters verbum org>
Date:   Sun Nov 17 18:46:45 2013 -0500

    gssh: Hold ref before destroying state
    
    Otherwise the task completion unrefs us, and we bomb out in
    g_object_notify().

 libgssh/gssh-connection.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libgssh/gssh-connection.c b/libgssh/gssh-connection.c
index 2de3474..2164c1a 100644
--- a/libgssh/gssh-connection.c
+++ b/libgssh/gssh-connection.c
@@ -118,6 +118,7 @@ state_transition_take_error (GSshConnection       *self,
                              GError                 *error)
 {
   g_debug ("caught error: %s", error->message);
+  g_object_ref (self);
 
   if (self->handshake_task)
     {
@@ -146,7 +147,10 @@ state_transition_take_error (GSshConnection       *self,
       else
         g_error_free (error);
     }
+
   state_transition (self, GSSH_CONNECTION_STATE_ERROR);
+
+  g_object_unref (self);
 }
 
 static gboolean


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