[Bf-blender-cvs] [f56392f] master: BLI_task: fix bad freeing of current task_thread in case POSIX thread creation fails.
Bastien Montagne
noreply at git.blender.org
Sun Oct 18 14:44:42 CEST 2015
Commit: f56392f224e6a7fa6b551d10006bea8bb08ebc6c
Author: Bastien Montagne
Date: Sun Oct 18 14:39:37 2015 +0200
Branches: master
https://developer.blender.org/rBf56392f224e6a7fa6b551d10006bea8bb08ebc6c
BLI_task: fix bad freeing of current task_thread in case POSIX thread creation fails.
Trying to MEM_free a single item of a whole MEM_calloc'ated array, tsst...
Luckily looks like POSIX thread creation does not fail often! :P
===================================================================
M source/blender/blenlib/intern/task.c
===================================================================
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index 08d40a1..a125bf7 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -207,7 +207,6 @@ TaskScheduler *BLI_task_scheduler_create(int num_threads)
if (pthread_create(&scheduler->threads[i], NULL, task_scheduler_thread_run, thread) != 0) {
fprintf(stderr, "TaskScheduler failed to launch thread %d/%d\n", i, num_threads);
- MEM_freeN(thread);
}
}
}
More information about the Bf-blender-cvs
mailing list