Revision: 1121
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1121&view=rev
Author:   nadvornik
Date:     2008-08-31 21:02:09 +0000 (Sun, 31 Aug 2008)

Log Message:
-----------
fixed error handling in image loader

Modified Paths:
--------------
    trunk/src/image-load.c

Modified: trunk/src/image-load.c
===================================================================
--- trunk/src/image-load.c      2008-08-31 18:53:11 UTC (rev 1120)
+++ trunk/src/image-load.c      2008-08-31 21:02:09 UTC (rev 1121)
@@ -87,6 +87,8 @@
        il->requested_height = 0;
        il->shrunk = FALSE;
 
+       il->can_destroy = TRUE;
+
 #ifdef HAVE_GTHREAD
        il->data_mutex = g_mutex_new();
        il->can_destroy_cond = g_cond_new();
@@ -124,8 +126,7 @@
                             G_STRUCT_OFFSET(ImageLoaderClass, error),
                             NULL, NULL,
                             g_cclosure_marshal_VOID__VOID,
-                            G_TYPE_NONE, 1,
-                            GDK_TYPE_EVENT);
+                            G_TYPE_NONE, 0);
 
        signals[SIGNAL_DONE] =
                g_signal_new("done",
@@ -705,6 +706,16 @@
        ImageLoader *il = data;
        gint cont = image_loader_begin(il);
        
+       if (!cont && !image_loader_get_pixbuf(il))
+               {
+               /* 
+               loader failed, we have to send signal 
+               (idle mode returns the image_loader_begin return value directly)
+               (success is always reported indirectly from image_loader_begin)
+               */
+               image_loader_emit_error(il);
+               }
+       
        while (cont && !image_loader_get_is_done(il) && 
!image_loader_get_stopping(il))
                {
                cont = image_loader_continue(il);
@@ -734,6 +745,8 @@
                image_loader_thread_pool = 
g_thread_pool_new(image_loader_thread_run, NULL, -1, FALSE, NULL);
                }
 
+       il->can_destroy = FALSE; /* ImageLoader can't be freed until 
image_loader_thread_run finishes */
+
        g_thread_pool_push(image_loader_thread_pool, il, NULL);
        DEBUG_1("Thread pool num threads: %d", 
g_thread_pool_get_num_threads(image_loader_thread_pool));
                


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to