Use wxSetAssertHandler() instead of changing wxTheAssertHandler

This commit is contained in:
Mathias Grimmberger 2017-05-02 10:14:02 +02:00 committed by Maciej Suminski
parent 000ee22e39
commit 097f89dcbc
1 changed files with 2 additions and 3 deletions

View File

@ -65,15 +65,14 @@ public:
WX_QUIET() WX_QUIET()
{ {
m_old_level = wxLog::GetLogLevel(); m_old_level = wxLog::GetLogLevel();
m_old_handler = wxTheAssertHandler; m_old_handler = wxSetAssertHandler( nullptr );
wxTheAssertHandler = nullptr;
wxLog::SetLogLevel( wxLOG_FatalError ); wxLog::SetLogLevel( wxLOG_FatalError );
} }
~WX_QUIET() ~WX_QUIET()
{ {
wxLog::SetLogLevel( m_old_level ); wxLog::SetLogLevel( m_old_level );
wxTheAssertHandler = m_old_handler; wxSetAssertHandler( m_old_handler );
} }
}; };