]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Don't refcount TimeoutCallback
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 5 Aug 2011 12:21:59 +0000 (13:21 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 19 Sep 2011 12:50:38 +0000 (13:50 +0100)
It turns out that timeout_callback_ref() is no longer called anywhere.

dbus/dbus-mainloop.c

index d2906f8354e1f034cc833d608a5e28aff515c45a..1a046a1f58deb99629c0331be97cad0d00247027 100644 (file)
@@ -99,7 +99,6 @@ watch_flags_from_poll_revents (short revents)
 
 typedef struct
 {
-  int refcount;
   DBusTimeout *timeout;
   unsigned long last_tv_sec;
   unsigned long last_tv_usec;
@@ -119,31 +118,13 @@ timeout_callback_new (DBusTimeout         *timeout)
   cb->timeout = timeout;
   _dbus_get_current_time (&cb->last_tv_sec,
                           &cb->last_tv_usec);
-  cb->refcount = 1;
-  return cb;
-}
-
-static TimeoutCallback *
-timeout_callback_ref (TimeoutCallback *cb)
-{
-  _dbus_assert (cb->refcount > 0);
-  
-  cb->refcount += 1;
-
   return cb;
 }
 
 static void
-timeout_callback_unref (TimeoutCallback *cb)
+timeout_callback_free (TimeoutCallback *cb)
 {
-  _dbus_assert (cb->refcount > 0);
-
-  cb->refcount -= 1;
-
-  if (cb->refcount == 0)
-    {
-      dbus_free (cb);
-    }
+  dbus_free (cb);
 }
 
 static void
@@ -378,7 +359,7 @@ _dbus_loop_add_timeout (DBusLoop           *loop,
     }
   else
     {
-      timeout_callback_unref (tcb);
+      timeout_callback_free (tcb);
       return FALSE;
     }
   
@@ -402,7 +383,7 @@ _dbus_loop_remove_timeout (DBusLoop           *loop,
           _dbus_list_remove_link (&loop->timeouts, link);
           loop->callback_list_serial += 1;
           loop->timeout_count -= 1;
-          timeout_callback_unref (this);
+          timeout_callback_free (this);
 
           return;
         }