[mutter] input-settings: Disconnect device signals on dispose



commit c956193d09732de196b80f85f580a600cab9e05e
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Fri Sep 11 12:08:45 2020 +0200

    input-settings: Disconnect device signals on dispose
    
    The input settings constructor installs callback functions on device
    added/remove and tool-changed.
    
    However, on dispose, those signals are not disconnected, meaning that on
    teardown, once the devices get removed eventually, the callback will
    still fire and call the callback with freed data, causing a crash.
    
    Make sure we clear the signals on devices on dispose, to avoid the crash
    on teardown.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1438

 src/backends/meta-input-settings.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 8bfc950235..0efaeb6557 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -153,6 +153,8 @@ meta_input_settings_dispose (GObject *object)
   MetaInputSettings *settings = META_INPUT_SETTINGS (object);
   MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (settings);
 
+  g_signal_handlers_disconnect_by_data (priv->seat, settings);
+
   g_clear_object (&priv->virtual_pad_keyboard);
 
   g_clear_object (&priv->mouse_settings);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]