summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluis <ldearquer@gmail.com>2015-05-05 13:45:49 +0200
committerluis <ldearquer@gmail.com>2015-05-05 13:45:49 +0200
commit2a6366f03996e6736516d65a02afdb370e282af9 (patch)
treeaad907391faee886ede2761bc7dfc1dccbe583d0
parentd17518aadb0ffcba54ed4fdf7ca08b01b70c9eb7 (diff)
Make GList clients consistent (items valid always).
-rw-r--r--http-launch/src/http-launch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/http-launch/src/http-launch.c b/http-launch/src/http-launch.c
index 38b4400..2521f3b 100644
--- a/http-launch/src/http-launch.c
+++ b/http-launch/src/http-launch.c
@@ -54,6 +54,10 @@ remove_client (Client * client)
{
g_print ("Removing connection %s\n", client->name);
+ G_LOCK (clients);
+ clients = g_list_remove (clients, client);
+ G_UNLOCK (clients);
+
g_free (client->name);
if (client->isource) {
@@ -67,10 +71,6 @@ remove_client (Client * client)
g_object_unref (client->connection);
g_byte_array_unref (client->current_message);
- G_LOCK (clients);
- clients = g_list_remove (clients, client);
- G_UNLOCK (clients);
-
g_slice_free (Client, client);
}