Browse Source

Move the custom assert handler to release builds only

newinvert
Mark Roszko 3 years ago
parent
commit
03990ee7e0
  1. 4
      common/single_top.cpp
  2. 5
      kicad/kicad.cpp

4
common/single_top.cpp

@ -133,6 +133,7 @@ private:
}; };
wxIMPLEMENT_DYNAMIC_CLASS(HtmlModule, wxModule); wxIMPLEMENT_DYNAMIC_CLASS(HtmlModule, wxModule);
#ifdef NDEBUG
// Define a custom assertion handler // Define a custom assertion handler
void CustomAssertHandler(const wxString& file, void CustomAssertHandler(const wxString& file,
int line, int line,
@ -142,6 +143,7 @@ void CustomAssertHandler(const wxString& file,
{ {
Pgm().HandleAssert( file, line, func, cond, msg ); Pgm().HandleAssert( file, line, func, cond, msg );
} }
#endif
/** /**
* Struct APP_SINGLE_TOP * Struct APP_SINGLE_TOP
@ -162,9 +164,9 @@ struct APP_SINGLE_TOP : public wxApp
#ifdef NDEBUG #ifdef NDEBUG
// These checks generate extra assert noise // These checks generate extra assert noise
wxSizerFlags::DisableConsistencyChecks(); wxSizerFlags::DisableConsistencyChecks();
#endif
wxDISABLE_DEBUG_SUPPORT(); wxDISABLE_DEBUG_SUPPORT();
wxSetAssertHandler( CustomAssertHandler ); wxSetAssertHandler( CustomAssertHandler );
#endif
// Perform platform-specific init tasks // Perform platform-specific init tasks
if( !KIPLATFORM::APP::Init() ) if( !KIPLATFORM::APP::Init() )

5
kicad/kicad.cpp

@ -406,7 +406,7 @@ void PGM_KICAD::Destroy()
KIWAY Kiway( &Pgm(), KFCTL_CPP_PROJECT_SUITE ); KIWAY Kiway( &Pgm(), KFCTL_CPP_PROJECT_SUITE );
#ifdef NDEBUG
// Define a custom assertion handler // Define a custom assertion handler
void CustomAssertHandler(const wxString& file, void CustomAssertHandler(const wxString& file,
int line, int line,
@ -416,6 +416,7 @@ void CustomAssertHandler(const wxString& file,
{ {
Pgm().HandleAssert( file, line, func, cond, msg ); Pgm().HandleAssert( file, line, func, cond, msg );
} }
#endif
/** /**
* Not publicly visible because most of the action is in #PGM_KICAD these days. * Not publicly visible because most of the action is in #PGM_KICAD these days.
@ -434,9 +435,9 @@ struct APP_KICAD : public wxApp
#ifdef NDEBUG #ifdef NDEBUG
// These checks generate extra assert noise // These checks generate extra assert noise
wxSizerFlags::DisableConsistencyChecks(); wxSizerFlags::DisableConsistencyChecks();
#endif
wxDISABLE_DEBUG_SUPPORT(); wxDISABLE_DEBUG_SUPPORT();
wxSetAssertHandler( CustomAssertHandler ); wxSetAssertHandler( CustomAssertHandler );
#endif
// Perform platform-specific init tasks // Perform platform-specific init tasks
if( !KIPLATFORM::APP::Init() ) if( !KIPLATFORM::APP::Init() )

Loading…
Cancel
Save