GList *list_names; /* dbus_name */
GList *list_object; /* dbus_object_handle_s */
pthread_mutex_t mutex;
+ GMainContext *main_context;
} dbus_handle_s;
/* path + interfaces */
gdbus_lock(dh);
if (!dh->conn) {
+ dh->main_context = g_main_context_new();
+ g_main_context_push_thread_default(dh->main_context);
dh->conn = _get_bus_private(bus_type);
+ g_main_context_pop_thread_default(dh->main_context);
dh->priv = TRUE;
dh->bus_type = bus_type;
if (!dh->conn)
return dh;
err:
if (dh) {
+ g_main_context_unref(dh->main_context);
gdbus_unlock(dh);
free(dh);
}
g_error_free(err);
err = NULL;
}
+
+ if (!g_main_context_iteration(pdh->main_context, FALSE)) {
+ _W("Cannot dispatch and handle an idle source from connection close");
+ g_object_unref(pdh->conn);
+ }
+
+ g_main_context_unref(pdh->main_context);
}
/* _free_func_object callback free the data */