core: avoid assertion "signal_id != 0" on unexported object

When unexporting an object, we might have a notification
pending. When the notification is finally processed, it
would find no "priv->interfaces" and raise an assertion

  "idle_emit_properties_changed: assertion 'signal_id != 0' failed"

https://bugzilla.redhat.com/show_bug.cgi?id=1253326

Fixes: 073991f5a8
This commit is contained in:
Thomas Haller
2015-08-13 17:04:39 +02:00
parent 088e606fcc
commit cad5406417

View File

@@ -523,6 +523,13 @@ nm_exported_object_unexport (NMExportedObject *self)
nm_bus_manager_unregister_object (nm_bus_manager_get (), iter->data); nm_bus_manager_unregister_object (nm_bus_manager_get (), iter->data);
g_slist_free_full (priv->interfaces, g_object_unref); g_slist_free_full (priv->interfaces, g_object_unref);
priv->interfaces = NULL; priv->interfaces = NULL;
if (nm_clear_g_source (&priv->notify_idle_id)) {
/* We had a notification queued. Since we removed all interfaces,
* the notification is obsolete and must be cleaned up. */
g_variant_builder_clear (&priv->pending_notifies);
g_variant_builder_init (&priv->pending_notifies, G_VARIANT_TYPE_VARDICT);
}
} }
static void static void