Merge branch 'dbus-1.2'
authorThiago Macieira <thiago@kde.org>
Sat, 7 Jun 2008 15:48:04 +0000 (17:48 +0200)
committerThiago Macieira <thiago@kde.org>
Sat, 7 Jun 2008 15:48:04 +0000 (17:48 +0200)
1  2 
dbus/dbus-connection.c

@@@ -3416,14 -3411,9 +3416,13 @@@ _dbus_connection_read_write_dispatch (D
                                       dbus_bool_t     dispatch)
  {
    DBusDispatchStatus dstatus;
--  dbus_bool_t no_progress_possible;
+   dbus_bool_t progress_possible;
 -  
 +
 +  /* Need to grab a ref here in case we're a private connection and
 +   * the user drops the last ref in a handler we call; see bug 
 +   * https://bugs.freedesktop.org/show_bug.cgi?id=15635
 +   */
 +  dbus_connection_ref (connection);
-   
    dstatus = dbus_connection_get_dispatch_status (connection);
  
    if (dispatch && dstatus == DBUS_DISPATCH_DATA_REMAINS)
     * as long as the transport is open.
     */
    if (dispatch)
-     no_progress_possible = connection->n_incoming == 0 &&
-       connection->disconnect_message_link == NULL;
+     progress_possible = connection->n_incoming != 0 ||
+       connection->disconnect_message_link != NULL;
    else
-     no_progress_possible = _dbus_connection_get_is_connected_unlocked (connection);
+     progress_possible = _dbus_connection_get_is_connected_unlocked (connection);
  
    CONNECTION_UNLOCK (connection);
-   return !no_progress_possible; /* TRUE if we can make more progress */
 +
 +  dbus_connection_unref (connection);
 +
+   return progress_possible; /* TRUE if we can make more progress */
  }