Provide wxApp::StoreCurrentException() implementation for C++11.
When using C++11 we can provide implementations of wxApp::StoreCurrentException() and RethrowStoredException() ourselves and thus make catching exceptions outside of the event loop work by default. Do this and update the documentation and the sample to reflect it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -306,16 +306,25 @@ public:
|
||||
|
||||
// This function can be overridden to store the current exception, in view
|
||||
// of rethrowing it later when RethrowStoredException() is called. If the
|
||||
// exception was stored, return true. The default implementation returns
|
||||
// false, indicating that the exception wasn't stored and that the program
|
||||
// should be simply aborted.
|
||||
// exception was stored, return true. If the exception can't be stored,
|
||||
// i.e. if this function returns false, the program will abort after
|
||||
// calling OnUnhandledException().
|
||||
//
|
||||
// The default implementation of this function when using C++98 compiler
|
||||
// just returns false, as there is no generic way to store an arbitrary
|
||||
// exception in C++98 and each application must do it on its own for the
|
||||
// exceptions it uses in its overridden version. When using C++11, the
|
||||
// default implementation uses std::current_exception() and returns true,
|
||||
// so it's normally not necessary to override this method when using C++11.
|
||||
virtual bool StoreCurrentException();
|
||||
|
||||
// If StoreCurrentException() is overridden, this function should be
|
||||
// overridden as well to rethrow the exceptions stored by it when the
|
||||
// control gets back to our code, i.e. when it's safe to do it. The default
|
||||
// version does nothing.
|
||||
virtual void RethrowStoredException() { }
|
||||
// control gets back to our code, i.e. when it's safe to do it.
|
||||
//
|
||||
// The default version does nothing when using C++98 and uses
|
||||
// std::rethrow_exception() in C++11.
|
||||
virtual void RethrowStoredException();
|
||||
#endif // wxUSE_EXCEPTIONS
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user