[gimp] app: don't drop the last reference to "file" in gimp_data_set_file(), argh



commit 1aa5a85d2a38d9b14c9c00e1f0a918284c1b0733
Author: Michael Natterer <mitch gimp org>
Date:   Sat Jul 26 16:33:40 2014 +0200

    app: don't drop the last reference to "file" in gimp_data_set_file(), argh
    
    also improve precondition check in gimp_data_save().

 app/core/gimpdata.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/app/core/gimpdata.c b/app/core/gimpdata.c
index 66b6f6f..9aefa3a 100644
--- a/app/core/gimpdata.c
+++ b/app/core/gimpdata.c
@@ -515,7 +515,7 @@ gimp_data_save (GimpData  *data,
       return TRUE;
     }
 
-  g_return_val_if_fail (private->file != NULL, FALSE);
+  g_return_val_if_fail (G_IS_FILE (private->file), FALSE);
 
   if (GIMP_DATA_GET_CLASS (data)->save)
     {
@@ -818,8 +818,6 @@ gimp_data_set_file (GimpData *data,
                   private->writable  = writable  ? TRUE : FALSE;
                   private->deletable = deletable ? TRUE : FALSE;
                 }
-
-              g_object_unref (file);
             }
 
           g_object_unref (parent);


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