fix: Multiple issues causing visualizers to crash when used _slightly_ incorrectly

This commit is contained in:
WerWolv
2024-07-10 20:50:58 +02:00
parent 9e1c2d5a2c
commit 07c259c9c1
21 changed files with 121 additions and 100 deletions

View File

@@ -172,17 +172,22 @@ namespace hex {
}
void Window::fullFrame() {
static u32 crashWatchdog = 0;
[[maybe_unused]] static u32 crashWatchdog = 0;
if (auto g = ImGui::GetCurrentContext(); g == nullptr || g->WithinFrameScope) {
return;
}
#if !defined(DEBUG)
try {
#endif
// Render an entire frame
this->frameBegin();
this->frame();
this->frameEnd();
#if !defined(DEBUG)
// Feed the watchdog
crashWatchdog = 0;
} catch (...) {
@@ -202,6 +207,7 @@ namespace hex {
// Handle the exception
handleException();
}
#endif
}
void Window::loop() {