summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-03-31 09:30:13 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-03-31 11:08:33 +0100
commit01548dd48a90b8f56a6a0d8763a26b1a71b0f9d2 (patch)
tree1be28ae76b30b599125273c1f4e9d55189ef4a79
parent37da8370cac07133af6d36a3b8403b70405ef220 (diff)
meta-porter: keep a ref on self during connecting a connection
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--wocky/wocky-meta-porter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/wocky/wocky-meta-porter.c b/wocky/wocky-meta-porter.c
index a4d0e2b..d425c70 100644
--- a/wocky/wocky-meta-porter.c
+++ b/wocky/wocky-meta-porter.c
@@ -385,7 +385,7 @@ new_connection_connect_cb (GObject *source,
{
DEBUG ("connection error: %s", error->message);
g_clear_error (&error);
- return;
+ goto out;
}
if (from != NULL)
@@ -440,6 +440,9 @@ new_connection_connect_cb (GObject *source,
}
g_object_unref (connection);
+
+out:
+ g_object_unref (self);
}
static gboolean
@@ -458,7 +461,7 @@ _new_connection (GSocketService *service,
DEBUG ("new connection from %s!", str);
wocky_ll_connector_incoming_async (G_IO_STREAM (socket_connection),
- NULL, new_connection_connect_cb, self);
+ NULL, new_connection_connect_cb, g_object_ref (self));
g_free (str);
g_object_unref (addr);