[gnome-commander/get_rid_of_xml] Do not just return in gnome_cmd_pixmap_free() if a member of the pixmap is null



commit 3cc6e38fdf4247dfc3ab39bb1125b8aea8ba734c
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sun Dec 2 22:38:57 2018 +0100

    Do not just return in gnome_cmd_pixmap_free() if a member of the pixmap is null

 src/gnome-cmd-pixmap.h | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/gnome-cmd-pixmap.h b/src/gnome-cmd-pixmap.h
index 24f07e29..5678fd30 100644
--- a/src/gnome-cmd-pixmap.h
+++ b/src/gnome-cmd-pixmap.h
@@ -40,13 +40,12 @@ inline void gnome_cmd_pixmap_free (GnomeCmdPixmap *pixmap)
     if (!pixmap)
         return;
 
-    g_return_if_fail (pixmap->pixbuf != NULL);
-    g_return_if_fail (pixmap->pixmap != NULL);
-    g_return_if_fail (pixmap->mask != NULL);
-
-    g_object_unref (pixmap->pixbuf);
-    g_object_unref (pixmap->pixmap);
-    g_object_unref (pixmap->mask);
+    if (pixmap->pixbuf != NULL)
+        g_object_unref (pixmap->pixbuf);
+    if (pixmap->pixmap != NULL)
+        g_object_unref (pixmap->pixmap);
+    if (pixmap->mask != NULL)
+        g_object_unref (pixmap->mask);
 
     g_free (pixmap);
 }


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