diff --git a/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp b/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp index 76bcc483..efe291fc 100644 --- a/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp +++ b/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp @@ -35,7 +35,7 @@ namespace Assets { buffer->align(Utils::Stream::ALIGN_4); - // not sure if this is neede but both brushside and brushedge need it and it can't hurt + // not sure if this is needed but both brushside and brushedge need it and it can't hurt for (int i = 0; i < asset->numCPlanes; ++i) { builder->storePointer(&asset->cPlanes[i]); diff --git a/src/Components/Modules/Exception.cpp b/src/Components/Modules/Exception.cpp index 7e64bfb1..3479dbc7 100644 --- a/src/Components/Modules/Exception.cpp +++ b/src/Components/Modules/Exception.cpp @@ -25,6 +25,12 @@ namespace Components { FreeConsole(); + if(IsWindow(Console::GetWindow()) != FALSE) + { + CloseWindow(Console::GetWindow()); + DestroyWindow(Console::GetWindow()); + } + if (IsWindow(Window::GetWindow()) != FALSE) { CloseWindow(Window::GetWindow()); @@ -34,10 +40,16 @@ namespace Components // This makes sure we either destroy the windows or wait till they are destroyed MSG msg; - while (IsWindow(Window::GetWindow()) != FALSE && GetMessage(&msg, nullptr, NULL, NULL)) + Utils::Time::Interval interval; + while (IsWindow(Window::GetWindow()) != FALSE && !interval.elapsed(2s)) { - TranslateMessage(&msg); - DispatchMessage(&msg); + if (PeekMessage(&msg, nullptr, NULL, NULL, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + std::this_thread::sleep_for(10ms); } }