fix for crash when terminating thumbnail threads
authorAndrea Weikert <elubie@gmx.net>
Sun, 18 Jul 2010 08:07:38 +0000 (08:07 +0000)
committerAndrea Weikert <elubie@gmx.net>
Sun, 18 Jul 2010 08:07:38 +0000 (08:07 +0000)
source/blender/windowmanager/intern/wm_jobs.c

index 80f1c68..3ebfac4 100644 (file)
@@ -355,9 +355,16 @@ void WM_jobs_kill(wmWindowManager *wm, void *owner, void *startjob)
 {
        wmJob *steve;
        
-       for(steve= wm->jobs.first; steve; steve= steve->next)
-               if(steve->owner==owner || steve->startjob==startjob)
-                       wm_jobs_kill_job(wm, steve);
+       steve= wm->jobs.first;
+       while(steve) {
+               if(steve->owner==owner || steve->startjob==startjob) {
+                       wmJob* bill = steve;
+                       steve= steve->next;
+                       wm_jobs_kill_job(wm, bill);
+               } else {
+                       steve= steve->next;
+               }
+       }
 }