diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-24 12:12:28 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-06-24 12:15:21 +0400 |
commit | cc0c94d535e4c0ee322876f6e6c7bd271f5316fa (patch) | |
tree | 921e41fd2622277e4e3c4700db79f5a543219392 | |
parent | 65bb121401300ffeda6539ddbdef44f2312ab074 (diff) |
Switch allocator to thread-safe when rendering from the command line
This is needed because render threads would do some allocations like
part buffer allocation and so. This is likely harmless with the lock
free allocator (not on Windows tho), but when using guarded allocator
we need to be sure access to the list of MemHead is safe.
-rw-r--r-- | source/creator/creator.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 11837025777..b42c5333d11 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1001,6 +1001,7 @@ static int render_frame(int argc, const char **argv, void *data) break; } + BLI_begin_threaded_malloc(); BKE_reports_init(&reports, RPT_PRINT); frame = CLAMPIS(frame, MINAFRAME, MAXFRAME); @@ -1008,6 +1009,7 @@ static int render_frame(int argc, const char **argv, void *data) RE_SetReports(re, &reports); RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, frame, frame, scene->r.frame_step); RE_SetReports(re, NULL); + BLI_end_threaded_malloc(); return 1; } else { @@ -1029,10 +1031,12 @@ static int render_animation(int UNUSED(argc), const char **UNUSED(argv), void *d Main *bmain = CTX_data_main(C); Render *re = RE_NewRender(scene->id.name); ReportList reports; + BLI_begin_threaded_malloc(); BKE_reports_init(&reports, RPT_PRINT); RE_SetReports(re, &reports); RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); RE_SetReports(re, NULL); + BLI_end_threaded_malloc(); } else { printf("\nError: no blend loaded. cannot use '-a'.\n"); |