add BT_SetTerminate to all threads

This commit is contained in:
2020-04-24 07:38:28 +02:00
parent 4a1df278d1
commit f041559212
6 changed files with 7 additions and 0 deletions

View File

@@ -674,6 +674,7 @@ void App::dialog_timelapse_export()
void App::dialog_export_mp4()
{
std::thread([this] {
BT_SetTerminate();
const int video_width = 1024;
const int video_height = 512;
const int video_frames = 500;

View File

@@ -1897,6 +1897,7 @@ void Canvas::export_depth(std::string file_name, std::function<void()> on_comple
if (App::I->check_license())
{
std::thread t([=] {
BT_SetTerminate();
export_depth_thread(file_name);
if (on_complete)
on_complete();

View File

@@ -780,6 +780,7 @@ LRESULT CALLBACK splash_proc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lPara
HWND splash_dialog;
void splash_thread_loop()
{
BT_SetTerminate();
splash_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SPLASH), NULL, reinterpret_cast<DLGPROC>(splash_proc));
MSG msg;

View File

@@ -841,6 +841,8 @@ bool NodePanelBrushPreset::export_ppbr(const std::string& path_in, const PPBRInf
bool NodePanelBrushPreset::import_ppbr(const std::string& path)
{
BT_SetTerminate();
Asset f;
if (f.open(path.c_str()))
{

View File

@@ -126,6 +126,7 @@ void NodePanelGrid::init_controls()
if (ShaderManager::ext_float32 || ShaderManager::ext_float16)
{
std::thread([this] {
BT_SetTerminate();
bake_uvs();
m_hm_shading->set_index(3);
m_shade_mode = ShadeMode::Textured;

View File

@@ -706,6 +706,7 @@ void parallel_for(size_t nb_elements, std::function<void(size_t i)> functor, boo
{
size_t start = i * batch_size;
my_threads[i] = std::thread([functor, start, batch_size]() {
BT_SetTerminate();
for (size_t j = start; j < start + batch_size; j++)
functor(j);
});