[gnome-utils] gdict: don't use gdk_cursor_unref()



commit fe8a98fd4f8115e695afa8c80240a9413ac9c1b2
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Dec 22 18:22:25 2010 +0100

    gdict: don't use gdk_cursor_unref()

 gnome-dictionary/libgdict/gdict-database-chooser.c |    6 +-----
 gnome-dictionary/libgdict/gdict-defbox.c           |   20 +++-----------------
 gnome-dictionary/libgdict/gdict-source-chooser.c   |    6 +-----
 gnome-dictionary/libgdict/gdict-speller.c          |    3 +--
 gnome-dictionary/libgdict/gdict-strategy-chooser.c |    6 +-----
 5 files changed, 7 insertions(+), 34 deletions(-)
---
diff --git a/gnome-dictionary/libgdict/gdict-database-chooser.c b/gnome-dictionary/libgdict/gdict-database-chooser.c
index 475b150..114f23c 100644
--- a/gnome-dictionary/libgdict/gdict-database-chooser.c
+++ b/gnome-dictionary/libgdict/gdict-database-chooser.c
@@ -188,11 +188,7 @@ gdict_database_chooser_dispose (GObject *gobject)
 
   set_gdict_context (chooser, NULL);
 
-  if (priv->busy_cursor)
-    {
-      gdk_cursor_unref (priv->busy_cursor);
-      priv->busy_cursor = NULL;
-    }
+  g_clear_object (&priv->busy_cursor);
 
   if (priv->store)
     {
diff --git a/gnome-dictionary/libgdict/gdict-defbox.c b/gnome-dictionary/libgdict/gdict-defbox.c
index 5d2f6a0..ec5edc5 100644
--- a/gnome-dictionary/libgdict/gdict-defbox.c
+++ b/gnome-dictionary/libgdict/gdict-defbox.c
@@ -189,23 +189,9 @@ gdict_defbox_dispose (GObject *gobject)
       priv->buffer = NULL;
     }
 
-  if (priv->busy_cursor)
-    {
-      gdk_cursor_unref (priv->busy_cursor);
-      priv->busy_cursor = NULL;
-    }
-
-  if (priv->hand_cursor)
-    {
-      gdk_cursor_unref (priv->hand_cursor);
-      priv->hand_cursor = NULL;
-    }
-
-  if (priv->regular_cursor)
-    {
-      gdk_cursor_unref (priv->regular_cursor);
-      priv->regular_cursor = NULL;
-    }
+  g_clear_object (&priv->busy_cursor);
+  g_clear_object (&priv->hand_cursor);
+  g_clear_object (&priv->regular_cursor);
 
   G_OBJECT_CLASS (gdict_defbox_parent_class)->dispose (gobject);
 }
diff --git a/gnome-dictionary/libgdict/gdict-source-chooser.c b/gnome-dictionary/libgdict/gdict-source-chooser.c
index ab640f8..7a829d9 100644
--- a/gnome-dictionary/libgdict/gdict-source-chooser.c
+++ b/gnome-dictionary/libgdict/gdict-source-chooser.c
@@ -127,11 +127,7 @@ gdict_source_chooser_dispose (GObject *gobject)
       priv->loader = NULL;
     }
 
-  if (priv->busy_cursor)
-    {
-      gdk_cursor_unref (priv->busy_cursor);
-      priv->busy_cursor = NULL;
-    }
+  g_clear_object (&priv->busy_cursor);
 
   G_OBJECT_CLASS (gdict_source_chooser_parent_class)->dispose (gobject);
 }
diff --git a/gnome-dictionary/libgdict/gdict-speller.c b/gnome-dictionary/libgdict/gdict-speller.c
index 7611e47..ebba6eb 100644
--- a/gnome-dictionary/libgdict/gdict-speller.c
+++ b/gnome-dictionary/libgdict/gdict-speller.c
@@ -172,8 +172,7 @@ gdict_speller_finalize (GObject *gobject)
   if (priv->context)
     set_gdict_context (speller, NULL);
 
-  if (priv->busy_cursor)
-    gdk_cursor_unref (priv->busy_cursor);
+  g_clear_object (&priv->busy_cursor);
 
   g_free (priv->strategy);
   g_free (priv->database);
diff --git a/gnome-dictionary/libgdict/gdict-strategy-chooser.c b/gnome-dictionary/libgdict/gdict-strategy-chooser.c
index 93df707..9c84b41 100644
--- a/gnome-dictionary/libgdict/gdict-strategy-chooser.c
+++ b/gnome-dictionary/libgdict/gdict-strategy-chooser.c
@@ -174,11 +174,7 @@ gdict_strategy_chooser_dispose (GObject *gobject)
 
   set_gdict_context (chooser, NULL);
 
-  if (priv->busy_cursor)
-    {
-      gdk_cursor_unref (priv->busy_cursor);
-      priv->busy_cursor = NULL;
-    }
+  g_clear_object (&priv->busy_cursor);
 
   if (priv->store)
     {



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