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
This commit is contained in:
parent
6ce1a1dce6
commit
f34ea2bd5e
1 changed files with 3 additions and 2 deletions
|
@ -1717,8 +1717,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue