From: englebass Date: Wed, 5 Nov 2008 20:29:05 +0000 (+0000) Subject: Don't close connection while idler active. X-Git-Tag: 2.0_alpha~43^2~445 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f23e4bd0951ff139197efe7ff8771a11461aa6f;p=framework%2Fuifw%2Fedbus.git Don't close connection while idler active. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@37483 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/dbus/e_dbus.c b/src/lib/dbus/e_dbus.c index 17b839e..42c561c 100644 --- a/src/lib/dbus/e_dbus.c +++ b/src/lib/dbus/e_dbus.c @@ -22,6 +22,7 @@ static int connection_slot = -1; static int init = 0; +static int close_connection = 0; EAPI int E_DBUS_EVENT_SIGNAL = 0; static E_DBus_Connection *shared_connections[2] = {NULL, NULL}; @@ -438,6 +439,13 @@ e_dbus_idler(void *data) dbus_connection_unref(cd->conn); e_dbus_signal_handlers_clean(cd); e_dbus_idler_active--; + if (!e_dbus_idler_active && close_connection) + { + do + { + e_dbus_connection_close(cd); + } while (--close_connection); + } return 1; } @@ -542,6 +550,11 @@ e_dbus_connection_close(E_DBus_Connection *conn) { DEBUG(5, "e_dbus_connection_close\n"); + if (e_dbus_idler_active) + { + close_connection++; + return; + } if (--(conn->refcount) != 0) return; dbus_connection_free_data_slot(&connection_slot);