From 0d8692da20e2b0fa3fbc1606a7b3782bc1c9ecc0 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 12 Apr 2018 08:47:09 +0200 Subject: [PATCH] Changed ACTION_MANAGER assert() calls to wxASSERT() wxASSERT(), contrary to assert() does not terminate the program when triggered. As assertions in ACTION_MANAGER are not critical and should be treated as warnings - there is no need to close the program. --- common/tool/action_manager.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index 35d190fe0e..61072ba624 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -29,7 +29,6 @@ #include #include -#include ACTION_MANAGER::ACTION_MANAGER( TOOL_MANAGER* aToolManager ) : m_toolMgr( aToolManager ) @@ -62,10 +61,10 @@ void ACTION_MANAGER::RegisterAction( TOOL_ACTION* aAction ) { // TOOL_ACTIONs are supposed to be named [appName.]toolName.actionName (with dots between) // action name without specifying at least toolName is not valid - assert( aAction->GetName().find( '.', 0 ) != std::string::npos ); + wxASSERT( aAction->GetName().find( '.', 0 ) != std::string::npos ); // TOOL_ACTIONs must have unique names & ids - assert( m_actionNameIndex.find( aAction->m_name ) == m_actionNameIndex.end() ); + wxASSERT( m_actionNameIndex.find( aAction->m_name ) == m_actionNameIndex.end() ); m_actionNameIndex[aAction->m_name] = aAction; } @@ -84,7 +83,7 @@ void ACTION_MANAGER::UnregisterAction( TOOL_ACTION* aAction ) if( action != actions.end() ) actions.erase( action ); else - assert( false ); + wxASSERT( false ); } } @@ -144,7 +143,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const { // Store the global action for the hot key in case there was no possible // context actions to run - assert( global == NULL ); // there should be only one global action per hot key + wxASSERT( global == NULL ); // there should be only one global action per hot key global = action; continue; } @@ -220,7 +219,7 @@ void ACTION_MANAGER::UpdateHotKeys() ++global_actions_cnt; } - assert( global_actions_cnt <= 1 ); + wxASSERT( global_actions_cnt <= 1 ); } #endif /* not NDEBUG */ }