summaryrefslogtreecommitdiff
path: root/src/lib/ethumb_client
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-27 17:20:25 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-27 17:20:25 +0900
commitd573133ff8d865608a4839104de7e17ad507ae6d (patch)
treec3393b7c7c650f301a3bf4f96ec9853b41ae03aa /src/lib/ethumb_client
parent33372313a176012effc39b623750c3de7561de3e (diff)
fix ethumb client segv's i've been hunting...
Diffstat (limited to 'src/lib/ethumb_client')
-rw-r--r--src/lib/ethumb_client/ethumb_client.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/lib/ethumb_client/ethumb_client.c b/src/lib/ethumb_client/ethumb_client.c
index b21ddf4faa..0d86962504 100644
--- a/src/lib/ethumb_client/ethumb_client.c
+++ b/src/lib/ethumb_client/ethumb_client.c
@@ -205,11 +205,16 @@ _ethumb_client_free(Ethumb_Client *client)
205 EINA_LIST_FREE(client->pending_add, data) 205 EINA_LIST_FREE(client->pending_add, data)
206 { 206 {
207 struct _ethumb_pending_add *pending = data; 207 struct _ethumb_pending_add *pending = data;
208 pending->client = NULL;
209 if (pending->pending_call) 208 if (pending->pending_call)
210 eldbus_pending_cancel(pending->pending_call); 209 {
210 eldbus_pending_cancel(pending->pending_call);
211 pending->client = NULL;
212 }
211 else 213 else
212 free(pending); 214 {
215 pending->client = NULL;
216 free(pending);
217 }
213 } 218 }
214 219
215 EINA_LIST_FREE(client->pending_gen, data) 220 EINA_LIST_FREE(client->pending_gen, data)
@@ -229,11 +234,16 @@ _ethumb_client_free(Ethumb_Client *client)
229 struct _ethumb_pending_remove *pending = data; 234 struct _ethumb_pending_remove *pending = data;
230 if (pending->free_data) 235 if (pending->free_data)
231 pending->free_data(pending->data); 236 pending->free_data(pending->data);
232 pending->client = NULL;
233 if (pending->pending_call) 237 if (pending->pending_call)
234 eldbus_pending_cancel(pending->pending_call); 238 {
239 eldbus_pending_cancel(pending->pending_call);
240 pending->client = NULL;
241 }
235 else 242 else
236 free(pending); 243 {
244 pending->client = NULL;
245 free(pending);
246 }
237 } 247 }
238 248
239 if (client->old_ethumb_conf) 249 if (client->old_ethumb_conf)
@@ -937,7 +947,7 @@ _ethumb_client_queue_add_cb(void *data, const Eldbus_Message *msg, Eldbus_Pendin
937 pending->pending_call = NULL; 947 pending->pending_call = NULL;
938 if (!client) goto end; 948 if (!client) goto end;
939 client->pending_add = eina_list_remove(client->pending_add, pending); 949 client->pending_add = eina_list_remove(client->pending_add, pending);
940 950
941 if (eldbus_message_error_get(msg, &errname, &errmsg)) 951 if (eldbus_message_error_get(msg, &errname, &errmsg))
942 { 952 {
943 ERR("Error: %s %s", errname, errmsg); 953 ERR("Error: %s %s", errname, errmsg);
@@ -950,6 +960,7 @@ _ethumb_client_queue_add_cb(void *data, const Eldbus_Message *msg, Eldbus_Pendin
950 goto end; 960 goto end;
951 } 961 }
952 962
963
953 generating = calloc(1, sizeof(*generating)); 964 generating = calloc(1, sizeof(*generating));
954 generating->id = id; 965 generating->id = id;
955 generating->file = pending->file; 966 generating->file = pending->file;
@@ -1002,10 +1013,11 @@ _ethumb_client_queue_add(Ethumb_Client *client, const char *file, const char *ke
1002 _ethumb_client_dbus_append_bytearray(main_itr, thumb); 1013 _ethumb_client_dbus_append_bytearray(main_itr, thumb);
1003 _ethumb_client_dbus_append_bytearray(main_itr, thumb_key); 1014 _ethumb_client_dbus_append_bytearray(main_itr, thumb_key);
1004 1015
1016 client->pending_add = eina_list_append(client->pending_add, pending);
1017
1005 pending->pending_call = eldbus_proxy_send(client->proxy, msg, 1018 pending->pending_call = eldbus_proxy_send(client->proxy, msg,
1006 _ethumb_client_queue_add_cb, 1019 _ethumb_client_queue_add_cb,
1007 pending, -1); 1020 pending, -1);
1008 client->pending_add = eina_list_append(client->pending_add, pending);
1009 1021
1010 return pending->id; 1022 return pending->id;
1011} 1023}
@@ -1099,7 +1111,8 @@ ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Gener
1099 l = l->next; 1111 l = l->next;
1100 continue; 1112 continue;
1101 } 1113 }
1102 eldbus_pending_cancel(pending_add->pending_call); 1114 if (pending_add->pending_call)
1115 eldbus_pending_cancel(pending_add->pending_call);
1103 pending_add->pending_call = NULL; 1116 pending_add->pending_call = NULL;
1104 found = 1; 1117 found = 1;
1105 break; 1118 break;