fixed reference count
authorVladimir Nadvornik <nadvornik@suse.cz>
Sun, 14 Feb 2010 21:35:11 +0000 (21:35 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Sun, 14 Feb 2010 21:35:11 +0000 (21:35 +0000)
there was a bug in reference count on writting unsaved metadata
before starting an external editor

src/utilops.c

index 093f6ae..347d126 100644 (file)
@@ -2744,11 +2744,15 @@ static gboolean file_util_write_metadata_first(UtilityType type, UtilityPhase ph
                FileData *fd = work->data;
                work = work->next;
                
-               if (fd->change) return FALSE; /* another op. in progress, let the caller handle it */
+               if (fd->change) 
+                       {
+                       filelist_free(unsaved);
+                       return FALSE; /* another op. in progress, let the caller handle it */
+                       }
                
                if (fd->modified_xmp) /* has unsaved metadata */
                        {
-                       unsaved = g_list_prepend(unsaved, fd);
+                       unsaved = g_list_prepend(unsaved, file_data_ref(fd));
                        }
                }