[gnome-software: 4/18] gs-app: Clean up dispose() method by using g_clear_object()




commit 2d9b22a31aaa632619825337dde6be6f3c1a7ae8
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu May 27 18:36:59 2021 +0100

    gs-app: Clean up dispose() method by using g_clear_object()
    
    This introduces no functional changes.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 lib/gs-app.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index e68889d20..aaa5d61a2 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -4850,12 +4850,9 @@ gs_app_finalize (GObject *object)
        g_ptr_array_unref (priv->categories);
        g_clear_pointer (&priv->key_colors, g_array_unref);
        g_clear_object (&priv->cancellable);
-       if (priv->local_file != NULL)
-               g_object_unref (priv->local_file);
-       if (priv->content_rating != NULL)
-               g_object_unref (priv->content_rating);
-       if (priv->action_screenshot != NULL)
-               g_object_unref (priv->action_screenshot);
+       g_clear_object (&priv->local_file);
+       g_clear_object (&priv->content_rating);
+       g_clear_object (&priv->action_screenshot);
 
        G_OBJECT_CLASS (gs_app_parent_class)->finalize (object);
 }


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