diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp index 10eb47d6c..b5a7f0f2e 100644 --- a/aegisub/src/main.cpp +++ b/aegisub/src/main.cpp @@ -154,11 +154,11 @@ void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName) { /// @param func Function name /// @param cond Condition /// @param msg Message -static void wxAssertHandler(const wxString &file, int line, const wxString &func, const wxString &cond, const wxString &msg) { +void AegisubApp::OnAssertFailure(const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg) { LOG_A("wx/assert") << file << ":" << line << ":" << func << "() " << cond << ": " << msg; + wxApp::OnAssertFailure(file, line, func, cond, msg); } - /// @brief Gets called when application starts. /// @return bool bool AegisubApp::OnInit() { diff --git a/aegisub/src/main.h b/aegisub/src/main.h index 57f5a79a8..e60bc7a7c 100644 --- a/aegisub/src/main.h +++ b/aegisub/src/main.h @@ -114,6 +114,14 @@ class AegisubApp: public wxApp { void OnFatalException(); #endif + /// @brief Handle wx assertions and redirect to the logging system. + /// @param file File name + /// @param line Line number + /// @param func Function name + /// @param cond Condition + /// @param msg Message + void OnAssertFailure(const wxChar *file, int line, const wxChar *func, const wxChar *cond, const wxChar *msg); + // This function wraps all event handler calls anywhere in the application and is // our ticket to catch exceptions happening in event handlers. void HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const;