force at least one idle call before writting metadata
authorVladimir Nadvornik <nadvornik@suse.cz>
Sat, 7 Feb 2009 21:03:11 +0000 (21:03 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Sat, 7 Feb 2009 21:03:11 +0000 (21:03 +0000)
(without this the exit_program_write_metadata_cb could be called
before the exit_program function finished)

src/utilops.c

index 020d6ca..5c824cc 100644 (file)
@@ -590,8 +590,16 @@ static gboolean file_util_perform_ci_internal(gpointer data)
 {
        UtilityData *ud = data;
 
-       /* this is removed when ud is destroyed */
-       if (ud->perform_idle_id == -1) ud->perform_idle_id = g_idle_add(file_util_perform_ci_internal, ud);
+       if (ud->perform_idle_id == -1) 
+               {
+               /* this function was called directly
+                  just setup idle callback and wait until we are called again
+               */
+               
+               /* this is removed when ud is destroyed */
+               ud->perform_idle_id = g_idle_add(file_util_perform_ci_internal, ud);
+               return TRUE;
+               }
 
        g_assert(ud->flist);