[gnome-control-center/gnome-3-30] power: Use g_signal_connect_object
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-30] power: Use g_signal_connect_object
- Date: Thu, 11 Oct 2018 20:17:28 +0000 (UTC)
commit 0e8f7487756e2c60acf84c1956701ab4fd4ebefd
Author: Andrea Azzarone <andrea azzarone canonical com>
Date: Wed Oct 10 20:10:27 2018 +0100
power: Use g_signal_connect_object
Objects created using the object storage API are not disposed when the panel
that created them is disposed. In order to prevent segfaults we need to manually
disconnect signal handler connected to these objects or we can do it
automatically using g_signal_connect_object.
Fixes: https://launchpad.net/bugs/1797205
panels/power/cc-power-panel.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index bfac953bc..298c2bfc9 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -1708,8 +1708,9 @@ iio_proxy_appeared_cb (GDBusConnection *connection,
return;
}
- g_signal_connect_swapped (G_OBJECT (self->iio_proxy), "g-properties-changed",
- G_CALLBACK (als_enabled_state_changed), self);
+ g_signal_connect_object (G_OBJECT (self->iio_proxy), "g-properties-changed",
+ G_CALLBACK (als_enabled_state_changed), self,
+ G_CONNECT_SWAPPED);
als_enabled_state_changed (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]