[gnome-shell] st-widget: Use g_clear_pointer
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] st-widget: Use g_clear_pointer
- Date: Sun, 20 Oct 2013 12:25:29 +0000 (UTC)
commit 4d1358b7ed483b3822ab889e4851cca2c3fa8841
Author: Adel Gadllah <adel gadllah gmail com>
Date: Sun Oct 20 14:00:16 2013 +0200
st-widget: Use g_clear_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=710541
src/st/st-widget.c | 19 +++----------------
1 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 15f45f6..9b1226e 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -338,17 +338,8 @@ st_widget_dispose (GObject *gobject)
StWidget *actor = ST_WIDGET (gobject);
StWidgetPrivate *priv = ST_WIDGET (actor)->priv;
- if (priv->theme)
- {
- g_object_unref (priv->theme);
- priv->theme = NULL;
- }
-
- if (priv->theme_node)
- {
- g_object_unref (priv->theme_node);
- priv->theme_node = NULL;
- }
+ g_clear_pointer (&priv->theme, g_object_unref);
+ g_clear_pointer (&priv->theme_node, g_object_unref);
st_widget_remove_transition (actor);
@@ -358,11 +349,7 @@ st_widget_dispose (GObject *gobject)
if (priv->accessible)
priv->accessible = NULL;
- if (priv->label_actor)
- {
- g_object_unref (priv->label_actor);
- priv->label_actor = NULL;
- }
+ g_clear_pointer (&priv->label_actor, g_object_unref);
if (priv->texture_file_changed_id != 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]