Closed izxyz closed 1 year ago
The code path on a error/crash is in https://github.com/koreader/android-luajit-launcher/blob/master/jni/main.c#L205-L208
We finish the NativeActivity, which is the proper thing to do. Albeit the framework will do it for us in case we don't exist cleanly, but that shouldn't happen.
Finishing the nativeActivity makes the zygote forked process where the app lives to be killed, so no memory leaks are possible here, until I miss something.
Do you have a test case that shows how an anormal exist would lead to memory leaks?
现在只是我的假想, 我还没有运行起来.因为在我的设备上无法运行 华为p30pro hoarmonyOS3.0
Yes. The app is just a shell. You need to add lua code to make it work. Have a look at examples/hello world
native层没有看到lua层对jni调用统计的代码, 那么在lua虚拟机异常停止后, 在lua层比如self.env[0]FindClass申请到的内存会不会得不到释放从而导致泄漏?