* evas_preload, ecore_thread: On memory allocation failure do call the cancel functi...
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 21 Dec 2009 12:25:32 +0000 (12:25 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 21 Dec 2009 12:25:32 +0000 (12:25 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@44624 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore/ecore_thread.c

index e4498e5..39cc829 100644 (file)
@@ -226,7 +226,11 @@ ecore_thread_run(void (*func_heavy)(void *data),
    Ecore_Pthread_Data *pth;
 
    work = malloc(sizeof (Ecore_Pthread_Worker));
-   if (!work) return NULL;
+   if (!work)
+     {
+       func_cancel(data);
+       return NULL;
+     }
 
    work->func_heavy = func_heavy;
    work->func_end = func_end;