Fix debug output about dbus server ref count
authorChengwei Yang <chengwei.yang@intel.com>
Fri, 23 Aug 2013 09:19:51 +0000 (17:19 +0800)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 23 Aug 2013 11:00:25 +0000 (12:00 +0100)
dbus_server_disconnect() invokes dbus_server_unref() at the end of
function, the latter will print a trace about server ref count decrease
1. However, it doesn't invoke dbus_server_ref(), so there isn't a trace
about server ref count increase in debug output.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
dbus/dbus-server.c

index 2c2b949..19d8590 100644 (file)
@@ -780,16 +780,7 @@ dbus_server_disconnect (DBusServer *server)
 {
   _dbus_return_if_fail (server != NULL);
 
-#ifdef DBUS_DISABLE_CHECKS
-  _dbus_atomic_inc (&server->refcount);
-#else
-    {
-      dbus_int32_t old_refcount = _dbus_atomic_inc (&server->refcount);
-
-      _dbus_return_if_fail (old_refcount > 0);
-    }
-#endif
-
+  dbus_server_ref (server);
   SERVER_LOCK (server);
 
   _dbus_assert (server->vtable->disconnect != NULL);