The problem can be easily seen in the "except" sample: choosing "Throw unhandled exception" menu item results in the application silently exiting with 0 exit code without any other messages.
This is wrong, it should display the exception in some way (under Windows it shows a message box and under Linux it at least prints something to stderr) and it definitely shouldn't exit with success exit code.
Looking at the code, this seems to be due to wxAppConsoleBase::RethrowStoredException() never being called under Mac. Under other platforms it is called from either wxEventLoopManual::ProcessEvents() or wxGUIEventLoop::DoRun() (wxGTK). We probably need to call it from either wxCFEventLoop::DoRun() or wxCFEventLoop::OSXDoRun().
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
In the sample the StoreCurrentException overload throws, but this called from WXConsumeException without a try catch guard in scope .. so the app exits
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I have to admit that I didn't really debug the sample, but I checked that it behaved differently from wxGTK where it exits with the error message and 255 exit code.
I did debug dialogs sample after replacing [] with .at() in wxFileDialog code and there is just exits silently too, which is definitely not expected.
As I wrote, I think it's because RethrowStoredException() is never called in wxOSX: the idea was that the exception could be temporarily stored but would be rethrown later if nobody did anything about it. And in wxOSX it just ends up being ignored.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
we are in WXConsumeException in the outer catch part, now the StoreCurrentException below throws, and I don't see where this should lead to an exception being stored ...
bool stored = false;
try
{
if ( wxTheApp )
stored = wxTheApp->StoreCurrentException();
}
catch ( ... )
{
// StoreCurrentException() really shouldn't throw, but if it
// did, take it as an indication that it didn't store it.
}
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()