chiark / gitweb /
dbus: don't hit an assert if we sent a changed signal for something not in the dbus...
authorLennart Poettering <lennart@poettering.net>
Sun, 11 Jul 2010 01:59:49 +0000 (03:59 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 11 Jul 2010 01:59:59 +0000 (03:59 +0200)
src/dbus-job.c
src/dbus-unit.c

index 653e11d..4572589 100644 (file)
@@ -172,10 +172,11 @@ void bus_job_send_change_signal(Job *j) {
         DBusMessage *m = NULL;
 
         assert(j);
-        assert(j->in_dbus_queue);
 
-        LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
-        j->in_dbus_queue = false;
+        if (j->in_dbus_queue) {
+                LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
+                j->in_dbus_queue = false;
+        }
 
         if (!bus_has_subscriber(j->manager) && !j->bus_client) {
                 j->sent_dbus_new_signal = true;
index ad0c193..735e5a5 100644 (file)
@@ -371,10 +371,11 @@ void bus_unit_send_change_signal(Unit *u) {
         DBusMessage *m = NULL;
 
         assert(u);
-        assert(u->meta.in_dbus_queue);
 
-        LIST_REMOVE(Meta, dbus_queue, u->meta.manager->dbus_unit_queue, &u->meta);
-        u->meta.in_dbus_queue = false;
+        if (u->meta.in_dbus_queue) {
+                LIST_REMOVE(Meta, dbus_queue, u->meta.manager->dbus_unit_queue, &u->meta);
+                u->meta.in_dbus_queue = false;
+        }
 
         if (!bus_has_subscriber(u->meta.manager)) {
                 u->meta.sent_dbus_new_signal = true;