summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2023-07-03 13:16:40 +0200
committerBastien Nocera <hadess@hadess.net>2023-07-03 17:21:17 +0200
commita0c7b16affb1dccc157cd9c64f32160a5270ae73 (patch)
tree22f32ea1ad1e0a0c97338c33854b830951548520
parentf82c55b416a010d014501721aed454c2d47d1a61 (diff)
lib: Avoid possible crash on daemon restart
#0 0x00007f40eb3e43a6 g_type_check_class_is_a (libgobject-2.0.so.0 + 0x3b3a6) #1 0x00007f40eb3c5253 g_object_class_find_property (libgobject-2.0.so.0 + 0x1c253) #2 0x00007f40bffcc668 up_device_changed_cb (libupower-glib.so.3 + 0xc668) #3 0x00007f40eb3bd4ea g_closure_invoke (libgobject-2.0.so.0 + 0x144ea) #4 0x00007f40eb3ebe16 signal_emit_unlocked_R.isra.0 (libgobject-2.0.so.0 + 0x42e16) #5 0x00007f40eb3dccbd g_signal_emit_valist (libgobject-2.0.so.0 + 0x33cbd) #6 0x00007f40eb3dcf33 g_signal_emit (libgobject-2.0.so.0 + 0x33f33) #7 0x00007f40eb3c86b4 g_object_dispatch_properties_changed.lto_priv.0 (libgobject-2.0.so.0 + 0x1f6b4) #8 0x00007f40eb3cef1f g_object_notify (libgobject-2.0.so.0 + 0x25f1f) #9 0x00007f40bffd5f1c up_exported_device_proxy_g_properties_changed (libupower-glib.so.3 + 0x15f1c) #10 0x00007f40eb3bd4ea g_closure_invoke (libgobject-2.0.so.0 + 0x144ea) #11 0x00007f40eb3ec315 signal_emit_unlocked_R.isra.0 (libgobject-2.0.so.0 + 0x43315) #12 0x00007f40eb3dccbd g_signal_emit_valist (libgobject-2.0.so.0 + 0x33cbd) #13 0x00007f40eb3dcf33 g_signal_emit (libgobject-2.0.so.0 + 0x33f33) #14 0x00007f40eb526fff process_get_all_reply (libgio-2.0.so.0 + 0x11dfff) #15 0x00007f40eb52a749 on_name_owner_changed_get_all_cb (libgio-2.0.so.0 + 0x121749)
-rw-r--r--libupower-glib/up-device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c
index d8978c4..9438b63 100644
--- a/libupower-glib/up-device.c
+++ b/libupower-glib/up-device.c
@@ -1259,6 +1259,12 @@ up_device_finalize (GObject *object)
device = UP_DEVICE (object);
+ if (device->priv->proxy_device != NULL) {
+ g_signal_handlers_disconnect_by_func (device->priv->proxy_device,
+ up_device_changed_cb,
+ device);
+ }
+
g_clear_object (&device->priv->proxy_device);
g_clear_pointer (&device->priv->offline_props, g_hash_table_unref);