esfml
esfml copied to clipboard
Restarting app results in crash
After fixing #22 I noticed that closing the app (by hitting the back button) and then restarting it results in an immediate crash of the app. I debugged the issue as much as I could today and found that the crash was occurring in the Android VideoModeImpl
when using the pointer returned by sf::priv::getActivityStates(NULL)
(in the getScreenSize()
function when creating the default desktop mode for creating a sf::RenderWindow
). The pointer returned by sf::priv::getActivityStates(NULL)
is the pointer from the previous execution, not the current execution (despite other calls to sf::priv::getActivityStates(NULL)
being fine, like in onNativeWindowCreated()
), and the usage of the mutex results in a crash.
Re-running the app after a crash results in the app running just fine. Re-running the app after a successful execution results in a crash. I tried reverting to some earlier versions but found this behavior to persist.
I think proper condition variables (like needed in #15) might help in fixing this. However, more time will have to be spent debugging this to find the exact cause and proper solution.