[gcab] trivial: Fix critical warning when unref'ing a GCabFile



commit 806e1c4b92d1830028e6675a86ee345aecfd6851
Author: Richard Hughes <richard hughsie com>
Date:   Tue Dec 12 22:36:48 2017 +0000

    trivial: Fix critical warning when unref'ing a GCabFile
    
    If we created this with gcab_folder_new_with_cfolder() the GFile is not set.

 libgcab/gcab-file.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libgcab/gcab-file.c b/libgcab/gcab-file.c
index d9a25b6..39284e4 100644
--- a/libgcab/gcab-file.c
+++ b/libgcab/gcab-file.c
@@ -62,7 +62,8 @@ gcab_file_finalize (GObject *object)
 {
     GCabFile *self = GCAB_FILE (object);
 
-    g_object_unref (self->file);
+    if (self->file != NULL)
+        g_object_unref (self->file);
     g_free (self->name);
     g_free (self->extract_name);
 


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