Move the custom assert handler to release builds only

This commit is contained in:
Mark Roszko
2023-06-13 13:04:37 +00:00
parent 4f39cb0789
commit 03990ee7e0
2 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -133,6 +133,7 @@ private:
};
wxIMPLEMENT_DYNAMIC_CLASS(HtmlModule, wxModule);
#ifdef NDEBUG
// Define a custom assertion handler
void CustomAssertHandler(const wxString& file,
int line,
@@ -142,6 +143,7 @@ void CustomAssertHandler(const wxString& file,
{
Pgm().HandleAssert( file, line, func, cond, msg );
}
#endif
/**
* Struct APP_SINGLE_TOP
@@ -162,9 +164,9 @@ struct APP_SINGLE_TOP : public wxApp
#ifdef NDEBUG
// These checks generate extra assert noise
wxSizerFlags::DisableConsistencyChecks();
#endif
wxDISABLE_DEBUG_SUPPORT();
wxSetAssertHandler( CustomAssertHandler );
#endif
// Perform platform-specific init tasks
if( !KIPLATFORM::APP::Init() )
+3 -2
View File
@@ -406,7 +406,7 @@ void PGM_KICAD::Destroy()
KIWAY Kiway( &Pgm(), KFCTL_CPP_PROJECT_SUITE );
#ifdef NDEBUG
// Define a custom assertion handler
void CustomAssertHandler(const wxString& file,
int line,
@@ -416,6 +416,7 @@ void CustomAssertHandler(const wxString& file,
{
Pgm().HandleAssert( file, line, func, cond, msg );
}
#endif
/**
* 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
// These checks generate extra assert noise
wxSizerFlags::DisableConsistencyChecks();
#endif
wxDISABLE_DEBUG_SUPPORT();
wxSetAssertHandler( CustomAssertHandler );
#endif
// Perform platform-specific init tasks
if( !KIPLATFORM::APP::Init() )