| Summary: | Android, no need of the listener thread | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sylvain <sylvain.becker> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | don't know | ||
| Hardware: | All | ||
| OS: | Android (All) | ||
| Attachments: | patch | ||
|
Description
Sylvain
2017-11-01 20:20:01 UTC
Does this handle the case when the native thread crashes? I tried and what I get is: Currently with the ThreadListener: - null pointer dereferencing in C will crash the whole activity. - calling a java method that throw an exception uncaught If you have a single jni call, app still runs, but when returning from SDLMain, at the end, there is a : E AndroidRuntime: FATAL EXCEPTION: SDLThread E AndroidRuntime: at org.libsdl.app.SDLActivity.functionThatCrash(Unknown Source) E AndroidRuntime: at org.libsdl.app.SDLActivity.nativeRunMain(Native Method) V SDL : onPause() V SDL : nativePause() V SDL : onWindowFocusChanged(): false V SDL : surfaceDestroyed() V SDL : onDestroy() It crashes, but Activity seems to terminate normally. Though at the end, there a pop-up "Would you like to restart the application!". If you have several jni calls, they will crash the activity because of the exception. Same behavior with my patch ... We could add a sigaction handler to catch the sigsev, but I don't think that's a good idea. Apps should just be debugged ... We could check exception after each jni call, I don't think that's a good idea neither. Exception should be caught within the java side. Sounds good, thanks! https://hg.libsdl.org/SDL/rev/cb780bb5093a |