[gnome-settings-daemon/gnome-3-16] wacom: Avoid warnings when switching VTs



commit 967a1d966c90e9d2510bdc741b5b3b0c83649a09
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Oct 7 18:42:58 2016 +0200

    wacom: Avoid warnings when switching VTs
    
    We get called for every removed GDK device, so check whether it's of
    interest early, instead after throwing a bunch of warnings.
    
    gsd-wacom[1884]: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
    gsd-wacom[1884]: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
    gsd-wacom[1884]: gsd_wacom_device_get_settings: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
    gsd-wacom[1884]: invalid (NULL) pointer instance
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772581

 plugins/wacom/gsd-wacom-manager.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index d25a2c1..a182f4a 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -1171,6 +1171,9 @@ gsd_wacom_manager_remove_gdk_device (GsdWacomManager *manager,
                 gdk_device_get_name (gdk_device));
 
        device = g_hash_table_lookup (manager->priv->devices, gdk_device);
+       if (!device)
+               return;
+
        type = gsd_wacom_device_get_device_type (device);
        settings = gsd_wacom_device_get_settings (device);
 


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