Revert "libgdbus: Add a context to handle pending event sources" 52/324752/1 accepted/tizen/unified/20250530.090441 accepted/tizen/unified/x/20250531.233004
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 26 May 2025 00:39:44 +0000 (09:39 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 26 May 2025 00:40:31 +0000 (09:40 +0900)
This reverts commit 71916d448bef629f11dfa2938fd48d4ba1167948.

Change-Id: Ic5f33fea5dd93b855732bdd96bbdd213016a6cd2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/libgdbus/libgdbus.c

index 91709ba9f6ece80c19d3ad7eebd6304a313f8de0..d206064ebfe69487ef67f016139ed6e60caa7b6d 100644 (file)
@@ -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 */