rzhukov
07/06/2023, 8:23 AMThrowable
to NSException
and raise it.
I expect that NSException will terminate the app via default platform termination way. But what I see is that terminate_handler from the second KMM library handles it. So I'm observing 5 seconds sleep.
In debug session I checking std::get_tetminate()
just before raising NSException and it is what I set before. I was able to debug the place, where that wrong termination handler appears in native code: raised exception starts handling at __cxa_begin_catch
. It fetches __cxa_get_globals()
and then exception_header
. And there comes wrong KN terminate handler.
If I disable second library, everything work as expected.
In another sample app with similar setup everything works good and termination handler doesn't replace default.
How can that be? I don't see that second library sets own termination handler, I see that my termination handler correctly set, but it doesn't work.
I appreciate any suggestion. Thanks!