FIX: Yield when join media thread

Change-Id: I746d7df88a0de8363da7d9507cb63c9e0ffe970a
Jira: STUDIO-5952
This commit is contained in:
chunmao.guo 2024-01-17 20:01:13 +08:00 committed by Lane.Wei
parent 022e9a24cb
commit 168d5dfe67
1 changed files with 4 additions and 1 deletions

View File

@ -23,6 +23,7 @@
#endif
#include <wx/clipbrd.h>
#include "wx/evtloop.h"
namespace Slic3r {
namespace GUI {
@ -104,7 +105,9 @@ MediaPlayCtrl::~MediaPlayCtrl()
m_tasks.push_back("<exit>");
m_cond.notify_all();
}
m_thread.join();
while (!m_thread.try_join_for(boost::chrono::milliseconds(10))) {
wxEventLoopBase::GetActive()->Yield();
}
}
wxString hide_id_middle_string(wxString const &str, size_t offset = 0, size_t length = -1)