[clutter/clutter-1.18] input-device: Use g_clear_pointer



commit 507d8b1cef4dfbe9489b44ff3f68cd9265c9ddf6
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Nov 21 16:23:00 2013 +0100

    input-device: Use g_clear_pointer
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712812

 clutter/clutter-input-device.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
---
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
index 07951e3..0c15432 100644
--- a/clutter/clutter-input-device.c
+++ b/clutter/clutter-input-device.c
@@ -93,23 +93,9 @@ clutter_input_device_dispose (GObject *gobject)
       device->associated = NULL;
     }
 
-  if (device->axes != NULL)
-    {
-      g_array_free (device->axes, TRUE);
-      device->axes = NULL;
-    }
-
-  if (device->keys != NULL)
-    {
-      g_array_free (device->keys, TRUE);
-      device->keys = NULL;
-    }
-
-  if (device->touch_sequences_info)
-    {
-      g_hash_table_unref (device->touch_sequences_info);
-      device->touch_sequences_info = NULL;
-    }
+  g_clear_pointer (&device->axes, g_array_unref);
+  g_clear_pointer (&device->keys, g_array_unref);
+  g_clear_pointer (&device->touch_sequences_info, g_hash_table_unref);
 
   if (device->inv_touch_sequence_actors)
     {


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