cancel pending calls in edbus if shutting down ctx...

SVN revision: 83835
This commit is contained in:
Carsten Haitzler 2013-02-12 03:47:00 +00:00
parent 6ba07f8dca
commit 1c0574d4bf
3 changed files with 13 additions and 4 deletions

View File

@ -334,6 +334,9 @@ systray_notifier_host_init(void)
void
systray_notifier_host_shutdown(void)
{
EDBus_Pending *p;
EINA_LIST_FREE(ctx->pending, p) edbus_pending_cancel(p);
systray_notifier_dbus_shutdown(ctx);
free(ctx);
ctx = NULL;

View File

@ -398,13 +398,14 @@ item_unregistered_local_cb(void *data, const char *service)
}
static void
name_request_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
name_request_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
{
const char *error, *error_msg;
unsigned flag;
EDBus_Object *obj;
Context_Notifier_Host *ctx = data;
ctx->pending = eina_list_remove(ctx->pending, pending);
if (edbus_message_error_get(msg, &error, &error_msg))
{
ERR("%s %s", error, error_msg);
@ -441,11 +442,15 @@ end:
void
systray_notifier_dbus_init(Context_Notifier_Host *ctx)
{
EDBus_Pending *p;
edbus_init();
ctx->conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
edbus_name_request(ctx->conn,
WATCHER_BUS, EDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING,
name_request_cb, ctx);
if (!ctx->conn) return;
p = edbus_name_request(ctx->conn,
WATCHER_BUS, EDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING,
name_request_cb, ctx);
if (p) ctx->pending = eina_list_append(ctx->pending, p);
}
void systray_notifier_dbus_shutdown(Context_Notifier_Host *ctx)

View File

@ -37,6 +37,7 @@ struct _Context_Notifier_Host
EDBus_Proxy *watcher;
Eina_Inlist *item_list;
Eina_Inlist *instances;
Eina_List *pending;
};
struct _Notifier_Item