summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-01-19 12:53:34 +0100
committerThomas Haller <thaller@redhat.com>2016-01-19 13:00:20 +0100
commit76f90812f456dd5dc2bfd12b1d56573a7c65f3d0 (patch)
treed9b122c5414cd090308f929ddc19cb4fccaea251
parent9e0ca0058be6e699939b913d9971b3ac6abe9f3c (diff)
device: clear queued_state callback in dispose
dispose() calls _cleanup_generic_pre() which in turn already calls nm_device_queued_state_clear(). So we would expect that at the end of dispose() no queued-state is pending. However, there there are crashes reports in queued_set_state() with the device instance already destructed (rh#1270247). Add this check trying to avoid the crash and closing in on the cause. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1180827 Related: https://bugzilla.redhat.com/show_bug.cgi?id=1270247 Related: https://bugzilla.redhat.com/show_bug.cgi?id=1298009
-rw-r--r--src/devices/nm-device.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index d2127fffc3..93782a4503 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -10244,7 +10244,7 @@ nm_device_queued_state_clear (NMDevice *self)
if (priv->queued_state.id) {
_LOGD (LOGD_DEVICE, "clearing queued state transition (id %d)",
priv->queued_state.id);
- g_source_remove (priv->queued_state.id);
+ nm_clear_g_source (&priv->queued_state.id);
nm_device_remove_pending_action (self, queued_state_to_string (priv->queued_state.state), TRUE);
}
memset (&priv->queued_state, 0, sizeof (priv->queued_state));
@@ -10651,6 +10651,13 @@ dispose (GObject *object)
}
G_OBJECT_CLASS (nm_device_parent_class)->dispose (object);
+
+ if (nm_clear_g_source (&priv->queued_state.id)) {
+ /* FIXME: we'd expect the queud_state to be alredy cleared and this statement
+ * not being necessary. Add this check here to hopefully investigate crash
+ * rh#1270247. */
+ g_return_if_reached ();
+ }
}
static void