From e94757c6b403f403eaa76be7d62e16bc1fe49905 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Mon, 26 May 2025 09:39:44 +0900 Subject: [PATCH] Revert "libgdbus: Add a context to handle pending event sources" This reverts commit 71916d448bef629f11dfa2938fd48d4ba1167948. Change-Id: Ic5f33fea5dd93b855732bdd96bbdd213016a6cd2 Signed-off-by: Youngjae Cho (cherry picked from commit 268c3cd93618af0c040c7acd3ef85a3ba56b51a2) --- src/libgdbus/libgdbus.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/libgdbus/libgdbus.c b/src/libgdbus/libgdbus.c index f9aeabc..248bb67 100644 --- a/src/libgdbus/libgdbus.c +++ b/src/libgdbus/libgdbus.c @@ -70,7 +70,6 @@ typedef struct { GList *list_names; /* dbus_name */ GList *list_object; /* dbus_object_handle_s */ pthread_mutex_t mutex; - GMainContext *main_context; } dbus_handle_s; /* path + interfaces */ @@ -248,10 +247,7 @@ static dbus_handle_s *_gdbus_get_connection_private(GBusType bus_type) 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) @@ -263,7 +259,6 @@ static dbus_handle_s *_gdbus_get_connection_private(GBusType bus_type) return dh; err: if (dh) { - g_main_context_unref(dh->main_context); gdbus_unlock(dh); free(dh); } @@ -657,13 +652,6 @@ int gdbus_free_connection(dbus_handle_h handle) 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 */ -- 2.34.1