Also, now that I think about it, I seem to recall that this issue was solved…are you using the latest SDL2 from HG?------------------------
Gabriel Jacobo mdqinc.com
The Android file code is in here:
src/core/android/SDL_android.cpp
From inspection, it looks to me like it’s doing the right thing. Does the
Java VM garbage collection need to kick in to actually close the file
references?On Thu, Feb 9, 2012 at 9:52 AM, Alexandr wrote:
As long as the code is calling close() it should suffice.On Sat, Feb 11, 2012 at 7:36 AM, Sam Lantinga wrote:
The Android file code is in here:
src/core/android/SDL_android.cpp
From inspection, it looks to me like it’s doing the right thing. Does the
Java VM garbage collection need to kick in to actually close the file
references?
There’s a mention to a related bug in that barren land that is the Android bug tracker. http://code.google.com/p/android/issues/detail?id=2123
It was closed in May 2009, but there’s a comment stating that the issue was present as of March 2010…perhaps it is still there, or perhaps you are using an old NDK/Android version?------------------------
Gabriel Jacobo mdqinc.com
Does the Java VM garbage collection need to kick in to actually close the file references?
Yes, kick it would be nice.
gabomdq wrote:
It was closed in May 2009, but there’s a comment stating that the issue was present as of March 2010…perhaps it is still there, or perhaps you are using an old NDK/Android version?
There’s a limit of “local references” for the native code of 512 entries.
The FileClose function was leaking 1 reference per call, and FileOpen tries
to reserve 16 references when it begins, so when you open the 497th file,
it fails (as there’s only 15 spaces left in the table). If you want to
learn more search for Android JNI Local and Global references, there’s
quite a bit of docs online.–
Gabriel.
There’s a limit of “local references” for the native code of 512 entries.
The FileClose function was leaking 1 reference per call, and FileOpen tries
to reserve 16 references when it begins, so when you open the 497th file,
it fails (as there’s only 15 spaces left in the table). If you want to
learn more search for Android JNI Local and Global references, there’s
quite a bit of docs online.