eldbus - only unref client conns that are not null after dispatch

This commit is contained in:
Carsten Haitzler 2013-07-04 08:41:45 +09:00
parent 64f8ea918c
commit bdd57af113
2 changed files with 3 additions and 2 deletions

View File

@ -772,7 +772,8 @@ eldbus_idler(void *data)
dbus_connection_ref(conn->dbus_conn);
DBG("Connection@%p: Dispatching", conn);
dbus_connection_dispatch(conn->dbus_conn);
dbus_connection_unref(conn->dbus_conn);
// add the if check as dispact may set conn->dbus_conn to NULL in a cb
if (conn->dbus_conn) dbus_connection_unref(conn->dbus_conn);
return ECORE_CALLBACK_RENEW;
}

View File

@ -238,7 +238,7 @@ end_connection:
obj = eldbus_proxy_object_get(client->proxy);
eldbus_proxy_unref(client->proxy);
eldbus_object_unref(obj);
eldbus_connection_unref(client->conn);
if (client->conn) eldbus_connection_unref(client->conn);
if (client->connect.free_data)
client->connect.free_data(client->connect.data);