Exception thrown from multithreaded shared lib not caught in main
Joao Luis Pinto
jpinto@inescporto.pt
Tue Dec 7 18:23:00 GMT 2004
Hi Martin,
>void Lixo::lib_func() throw()
>{
> throw Lixo::ValidationException("Hello!");
>}
>
>The above code, will result in a call to std::unexpected() and thus to std::terminare() and from there abort() resulting in the application exiting without the stack unwinding to main().
>
>By specifying that the method 'lib_func()' throws nothing 'throw()' any thrown exception (because they are all unexpected) should generate a call to std::unexpected().
>
>
That was it! Silly me... :$
Thanks for the reminder, and to Lyle for also having a look.
João Luis
More information about the Gcc-help
mailing list