mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Only show assertion popup for assertions on main thread
The SDL function may only be called from the main thread, so we can't show a popup for failed assertions on other threads.
This commit is contained in:
parent
262a2a83a6
commit
817d96a73d
|
@ -4589,7 +4589,10 @@ int main(int argc, const char **argv)
|
|||
pKernel->RegisterInterface(pClient, false);
|
||||
pClient->RegisterInterfaces();
|
||||
|
||||
dbg_assert_set_handler([pClient](const char *pMsg) {
|
||||
const std::thread::id MainThreadId = std::this_thread::get_id();
|
||||
dbg_assert_set_handler([MainThreadId, pClient](const char *pMsg) {
|
||||
if(MainThreadId != std::this_thread::get_id())
|
||||
return;
|
||||
char aVersionStr[128];
|
||||
if(os_version_str(aVersionStr, sizeof(aVersionStr)))
|
||||
str_copy(aVersionStr, "unknown");
|
||||
|
|
Loading…
Reference in a new issue