[gimp] Bug 660067 - GIMP crashes after Wacom tablet's hot unplug



commit 3b6ab5a48cd366ede815f31dddf11a36c4a9217a
Author: Michael Natterer <mitch gimp org>
Date:   Mon Sep 26 22:35:45 2011 +0200

    Bug 660067 - GIMP crashes after Wacom tablet's hot unplug
    
    Don't call gimp_input_device_store_lookup() with a NULL name. Unplug
    seems broken because we always get name == NULL, I need to fix this
    but at least it doesn't crash any longer (and the fix is generally
    correct and not a workaround).

 modules/gimpinputdevicestore-gudev.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/modules/gimpinputdevicestore-gudev.c b/modules/gimpinputdevicestore-gudev.c
index 072679e..d10874b 100644
--- a/modules/gimpinputdevicestore-gudev.c
+++ b/modules/gimpinputdevicestore-gudev.c
@@ -334,13 +334,16 @@ gimp_input_device_store_remove (GimpInputDeviceStore *store,
   const gchar *name = g_udev_device_get_sysfs_attr (device, "name");
   GtkTreeIter  iter;
 
-  if (gimp_input_device_store_lookup (store, name, &iter))
+  if (name)
     {
-      gtk_list_store_remove (GTK_LIST_STORE (store), &iter);
+      if (gimp_input_device_store_lookup (store, name, &iter))
+        {
+          gtk_list_store_remove (GTK_LIST_STORE (store), &iter);
 
-      g_signal_emit (store, store_signals[DEVICE_REMOVED], 0, name);
+          g_signal_emit (store, store_signals[DEVICE_REMOVED], 0, name);
 
-      return TRUE;
+          return TRUE;
+        }
     }
 
   return FALSE;



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