Author: post
Date: 2011-02-06 19:02:43 +0100 (Sun, 06 Feb 2011)
New Revision: 3814

Modified:
   trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp
Log:
Be sure we unlock IO, when attempting to open unreadable file.

Modified: trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp
===================================================================
--- trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp        2011-02-06 
17:22:45 UTC (rev 3813)
+++ trunk/plugins/load-rawspeed/rawstudio-plugin-api.cpp        2011-02-06 
18:02:43 UTC (rev 3814)
@@ -61,16 +61,33 @@
        RawDecoder *d = 0;
        FileMap* m = 0;
 
-       try
-       {
 #ifdef TIME_LOAD
                GTimer *gt = g_timer_new();
 #endif
 
+
+       try
+       {
                rs_io_lock();
                m = f.readFile();
                rs_io_unlock();
+       }
+       catch (FileIOException e)
+       {
+               rs_io_unlock();
+               printf("RawSpeed: File IO Exception: %s\n", e.what());
+               return rs_filter_response_new();
+       }
+       catch (...)
+       {
+               rs_io_unlock();
+               printf("RawSpeed: Exception when reading file\n");
+               return rs_filter_response_new();
+       }
 
+       try
+       {
+
 #ifdef TIME_LOAD
                printf("RawSpeed Open %s: %.03fs\n", filename, 
g_timer_elapsed(gt, NULL));
                g_timer_destroy(gt);


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to