You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't have any insight into this, I guess it needs some active debugging. If the segfault is happening during kivy's internal stop process then that's probably the first place to look.
Here's the problem I experienced (with crash in the same place):
Nobody destroys the app Window by default. Then long after Python is gone ("Python for android ended."), Java will call back via Activity.onPause() into SDL native code, which then references a stale Android_Window in Java_org_libsdl_app_SDLActivity_nativePause().
Workaround:
You must call WindowSDL.close() before the app exits the main EventLoop.
An ideal way to do this is to handle the event in App.on_stop():
from kivy.app import App
from kivy.core.window import Window
class MyFancyApplication(App):
def on_stop(self):
Window.close()
# ...
# somewhere else:
App.get_running_app().stop()
Reacted by Santiago Ruiz-Valdepeñas, Om Chimurkar, Amit Kumar Champatiray and Kavi
@inclement can you provide details about the basic kivy shutdown design? I guess that the event should be bound to something which cleans up the window without needing user code?
@gooroopy Sorry for the delay replying, and thanks a lot for the patch! I'm not familiar with this part of Kivy's internals, but if you didn't do so already it would be very welcome to open a PR in the kivy repo for it.
Activity
inclement commentedon May 7, 2016
I don't have any insight into this, I guess it needs some active debugging. If the segfault is happening during kivy's internal stop process then that's probably the first place to look.
cidermole commentedon Aug 12, 2016
Here's the problem I experienced (with crash in the same place):
Nobody destroys the app Window by default. Then long after Python is gone ("Python for android ended."), Java will call back via
Activity.onPause()into SDL native code, which then references a staleAndroid_WindowinJava_org_libsdl_app_SDLActivity_nativePause().Workaround:
You must call
WindowSDL.close()before the app exits the mainEventLoop.An ideal way to do this is to handle the event in
App.on_stop():cidermole commentedon Aug 12, 2016
@inclement can you provide details about the basic kivy shutdown design? I guess that the event should be bound to something which cleans up the window without needing user code?
gooroopy commentedon Aug 13, 2016
@cidermole I've also spent a few hours to fixed this issue a couple week ago, this is my patch :- http://pastebin.com/JthasWiG
@inclement I will submit PR to Kivy if this is make sense.
inclement commentedon Aug 31, 2016
@gooroopy Sorry for the delay replying, and thanks a lot for the patch! I'm not familiar with this part of Kivy's internals, but if you didn't do so already it would be very welcome to open a PR in the kivy repo for it.
inclement commentedon Jan 30, 2019
I believe this is no longer happening on p4a master. Recently I was testing this type of thing while getting pause to work with sdl2.0.9