- To override the default behaviour in the debug builds which is to show the
- user a dialog asking whether he wants to abort the program, continue or
- continue ignoring any subsequent assert failures, you may override
- wxApp::OnAssertFailure() which is called by this function if the global
- application object exists.
+ The default assert handler forwards to wxApp::OnAssertFailure() whose
+ default behaviour is, in turn, to show the standard assertion failure
+ dialog if a wxApp object exists or shows the same dialog itself directly
+ otherwise.
+
+ While usually it is enough -- and more convenient -- to just override
+ OnAssertFailure(), to handle all assertion failures, including those
+ occurring even before wxApp object creation of after its destruction you
+ need to provide your assertion handler function.
+
+ This function also provides a simple way to disable all asserts: simply
+ pass @NULL pointer to it. Doing this will result in not even evaluating
+ assert conditions at all, avoiding almost all run-time cost of asserts.
+
+ Notice that this function is not MT-safe, so you should call it before
+ starting any other threads.
+
+ The return value of this function is the previous assertion handler. It can
+ be called after any pre-processing by your handler and can also be restored
+ later if you uninstall your handler.
+
+ @param handler
+ The function to call in case of assertion failure or @NULL.
+ @return
+ The previous assert handler which is not @NULL by default but could be
+ @NULL if it had been previously set to this value using this function.
+
+ @since 2.9.0