summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTae-Hwan Kim <the81.kim@samsung.com>2014-02-11 17:52:28 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-11 17:52:28 +0900
commitc65a46caf3da823c9be5c9762d7facbf77f4c89d (patch)
tree10a03d4e98f253f3e616093fcfa706befad1d124
parent5a32eee24a9b1a4752a67e73916c15fc18a832a4 (diff)
Force to free e dbus connection
Summary: Do not use free function of dbus library. Sometimes free function will not be called. I don't know the reason exactly but edbus perform it asynchronously. so it can be called after edbus shutdown already. That can cause some problem. Reviewers: raster, cedric, Hermet, seoz, barbieri, lfelipe Differential Revision: https://phab.enlightenment.org/D481
-rw-r--r--src/lib/dbus/e_dbus.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/dbus/e_dbus.c b/src/lib/dbus/e_dbus.c
index 47d84bb..08be421 100644
--- a/src/lib/dbus/e_dbus.c
+++ b/src/lib/dbus/e_dbus.c
@@ -187,9 +187,8 @@ e_dbus_connection_new(DBusConnection *conn)
187} 187}
188 188
189static void 189static void
190e_dbus_connection_free(void *data) 190e_dbus_connection_free(E_DBus_Connection *cd)
191{ 191{
192 E_DBus_Connection *cd = data;
193 Ecore_Fd_Handler *fd_handler; 192 Ecore_Fd_Handler *fd_handler;
194 Ecore_Timer *timer; 193 Ecore_Timer *timer;
195 DBG("e_dbus_connection free!"); 194 DBG("e_dbus_connection free!");
@@ -489,7 +488,7 @@ e_dbus_connection_setup(DBusConnection *conn)
489 dbus_connection_set_exit_on_disconnect(cd->conn, EINA_FALSE); 488 dbus_connection_set_exit_on_disconnect(cd->conn, EINA_FALSE);
490 dbus_connection_allocate_data_slot(&connection_slot); 489 dbus_connection_allocate_data_slot(&connection_slot);
491 490
492 dbus_connection_set_data(cd->conn, connection_slot, (void *)cd, e_dbus_connection_free); 491 dbus_connection_set_data(cd->conn, connection_slot, (void *)cd, NULL);
493 dbus_connection_set_watch_functions(cd->conn, 492 dbus_connection_set_watch_functions(cd->conn,
494 cb_watch_add, 493 cb_watch_add,
495 cb_watch_del, 494 cb_watch_del,
@@ -551,6 +550,7 @@ e_dbus_connection_close(E_DBus_Connection *conn)
551 550
552 dbus_connection_close(conn->conn); 551 dbus_connection_close(conn->conn);
553 dbus_connection_unref(conn->conn); 552 dbus_connection_unref(conn->conn);
553 e_dbus_connection_free(conn);
554 554
555 // Note: the E_DBus_Connection gets freed when the dbus_connection is cleaned up by the previous unref 555 // Note: the E_DBus_Connection gets freed when the dbus_connection is cleaned up by the previous unref
556} 556}
@@ -615,6 +615,19 @@ e_dbus_shutdown(void)
615 if (--_edbus_init_count) 615 if (--_edbus_init_count)
616 return _edbus_init_count; 616 return _edbus_init_count;
617 617
618 // FIXME: this is workaround
619 while (shared_connections[DBUS_BUS_SESSION] &&
620 shared_connections[DBUS_BUS_SESSION]->refcount >= 1)
621 {
622 e_dbus_connection_close(shared_connections[DBUS_BUS_SESSION]);
623 }
624 // FIXME: this is workaround
625 while (shared_connections[DBUS_BUS_SYSTEM] &&
626 shared_connections[DBUS_BUS_SYSTEM]->refcount >= 1)
627 {
628 e_dbus_connection_close(shared_connections[DBUS_BUS_SYSTEM]);
629 }
630
618 e_dbus_object_shutdown(); 631 e_dbus_object_shutdown();
619 ecore_shutdown(); 632 ecore_shutdown();
620 eina_log_domain_unregister(_e_dbus_log_dom); 633 eina_log_domain_unregister(_e_dbus_log_dom);