From 97e7e6f314ae11fbad6d9f2f5a3312fd326cce1a Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 19 Sep 2011 01:55:23 +0300 Subject: [PATCH 14/18] IdleServerConnection: Simplify the dispose method If a connection was successfully made, then the instance will only be disposed if the disconnect method is explicitly called. Otherwise not. Fixes: https://bugs.freedesktop.org/37145 --- src/idle-server-connection.c | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-) diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c index 3668c4c..5b8629c 100644 --- a/src/idle-server-connection.c +++ b/src/idle-server-connection.c @@ -66,7 +66,6 @@ struct _IdleServerConnectionPrivate { GCancellable *cancellable; IdleServerConnectionState state; - gboolean dispose_has_run; }; static GObject *idle_server_connection_constructor(GType type, guint n_props, GObjectConstructParam *props); @@ -82,7 +81,6 @@ static void idle_server_connection_init(IdleServerConnection *conn) { priv->socket_client = g_socket_client_new(); priv->state = SERVER_CONNECTION_STATE_NOT_CONNECTED; - priv->dispose_has_run = FALSE; } static GObject *idle_server_connection_constructor(GType type, guint n_props, GObjectConstructParam *props) { @@ -97,16 +95,6 @@ static void idle_server_connection_dispose(GObject *obj) { IdleServerConnection *conn = IDLE_SERVER_CONNECTION(obj); IdleServerConnectionPrivate *priv = IDLE_SERVER_CONNECTION_GET_PRIVATE(conn); - if (priv->dispose_has_run) { - return; - } - - IDLE_DEBUG("dispose called"); - priv->dispose_has_run = TRUE; - - if (priv->state == SERVER_CONNECTION_STATE_CONNECTED) - idle_server_connection_disconnect_async(conn, NULL, NULL, NULL); - if (priv->socket_client != NULL) { g_object_unref(priv->socket_client); priv->socket_client = NULL; -- 1.7.6.2