From 167125a813f41ea44f777d43366e3e6349e0b539 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Tue, 2 Aug 2022 13:39:20 +0200 Subject: [PATCH] Fixed disabling of TBB parallelization on newer TBB --- src/libslic3r/utils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index 371b8eb11..d4fa30b4f 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -129,7 +129,9 @@ void disable_multi_threading() { // Disable parallelization so the Shiny profiler works #ifdef TBB_HAS_GLOBAL_CONTROL - tbb::global_control(tbb::global_control::max_allowed_parallelism, 1); + { + static tbb::global_control gc(tbb::global_control::max_allowed_parallelism, 1); + } #else // TBB_HAS_GLOBAL_CONTROL static tbb::task_scheduler_init *tbb_init = new tbb::task_scheduler_init(1); UNUSED(tbb_init);