Reenable the assertion failure handler

Originally committed to SVN as r6053.
This commit is contained in:
Thomas Goyne 2011-12-22 21:17:49 +00:00
parent 28e8f0b640
commit 59273bac4a
2 changed files with 10 additions and 2 deletions

View File

@ -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() {

View File

@ -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;