[clutter/clutter-1.6] device: Prevent segfault



commit cbe1a705bf9629bb44fd4c30df1e9c7cae770998
Author: Peter Ward <peteraward gmail com>
Date:   Sat May 28 00:12:15 2011 +1000

    device: Prevent segfault
    
    When disposing a slave device without a master.
    
    http://bugzilla.clutter-project.org/show_bug.cgi?id=2655
    (cherry picked from commit c836b8c53c473e7d309c6c0c9d25b3ec74c827ff)
    
    Signed-off-by: Emmanuele Bassi <ebassi linux intel com>

 clutter/clutter-input-device.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
index dd277d1..3f44b97 100644
--- a/clutter/clutter-input-device.c
+++ b/clutter/clutter-input-device.c
@@ -78,11 +78,11 @@ clutter_input_device_dispose (GObject *gobject)
 
   g_free (device->device_name);
 
-  if (device->device_mode == CLUTTER_INPUT_MODE_SLAVE)
-    _clutter_input_device_remove_slave (device->associated, device);
-
   if (device->associated != NULL)
     {
+      if (device->device_mode == CLUTTER_INPUT_MODE_SLAVE)
+        _clutter_input_device_remove_slave (device->associated, device);
+
       _clutter_input_device_set_associated_device (device->associated, NULL);
       g_object_unref (device->associated);
       device->associated = NULL;



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