eina: win32 release lock in case of error
authorMichelle Legrand <legrand.michelle@outlook.com>
Fri, 13 Feb 2015 13:33:58 +0000 (14:33 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Thu, 12 Mar 2015 06:43:58 +0000 (07:43 +0100)
Summary:
It's better to realese the lock before returning NULL. Otherwise the program
is waiting indefinitely then crashing on Windows ("program not responding").

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/eina/eina_file_win32.c

index efdb8eb..b515a68 100644 (file)
@@ -873,7 +873,10 @@ eina_file_map_all(Eina_File *file, Eina_File_Populate rule EINA_UNUSED)
         file->fm = CreateFileMapping(file->handle, NULL, PAGE_READONLY,
                                      max_size_high, max_size_low, NULL);
         if (!file->fm)
-          return NULL;
+          {
+             eina_lock_release(&file->lock);
+             return NULL;
+          }
 
         data = MapViewOfFile(file->fm, FILE_MAP_READ,
                              0, 0, file->length);