From: Enlightenment S. <no-...@en...> - 2009-08-28 16:54:34
|
Log: unref message when fail to set_notify or when not completed. Hey folks, Regarding edbus, I believe that when sending a message, if it fails to set_notify, it should cancel and unref the pending message. Another thing, if the pending call doesn't complete, it should free data and unref it too, right? I'm attaching a small patch to fix it. Please, somebody take a look at that when have some time. Thanks, By: Bruno Dilly <bd...@pr...> Author: barbieri Date: 2009-08-28 09:54:19 -0700 (Fri, 28 Aug 2009) New Revision: 42081 Modified: trunk/e_dbus/src/lib/dbus/e_dbus_message.c Modified: trunk/e_dbus/src/lib/dbus/e_dbus_message.c =================================================================== --- trunk/e_dbus/src/lib/dbus/e_dbus_message.c 2009-08-28 16:50:58 UTC (rev 42080) +++ trunk/e_dbus/src/lib/dbus/e_dbus_message.c 2009-08-28 16:54:19 UTC (rev 42081) @@ -19,6 +19,9 @@ if (!dbus_pending_call_get_completed(pending)) { printf("NOT COMPLETED\n"); + free(data); + dbus_message_unref(msg); + dbus_pending_call_unref(pending); return; } @@ -77,7 +80,12 @@ pdata->data = data; if (!dbus_pending_call_set_notify(pending, cb_pending, pdata, free)) + { free(pdata); + dbus_message_unref(msg); + dbus_pending_call_cancel(pending); + return NULL; + } } return pending; |