Skip to content

Commit

Permalink
Remove noexcept from UserPanicHandler::call() so that panic handlers …
Browse files Browse the repository at this point in the history
…can throw. Without this change, throwing inside the user panic handler calls terminate(). Note that the docs for setPanicHandler() explicitly say that it's okay for the handler to throw, which is not true prior to this change.
  • Loading branch information
emezeske authored and pixelflinger committed Jan 29, 2025
1 parent 48a2c64 commit 4465e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/utils/src/Panic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class UserPanicHandler {
struct CallBack {
Panic::PanicHandlerCallback handler = nullptr;
void* user = nullptr;
void call(Panic const& panic) const noexcept {
void call(Panic const& panic) const {
if (UTILS_UNLIKELY(handler)) {
handler(user, panic);
}
Expand All @@ -64,7 +64,7 @@ class UserPanicHandler {
return data;
}

void call(Panic const& panic) const noexcept {
void call(Panic const& panic) const {
getCallback().call(panic);
}

Expand Down

0 comments on commit 4465e6c

Please sign in to comment.