mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Android: Fixed problems with memory leaks due to absent ReleaseStringUTFChars calls.
This commit is contained in:
parent
f0f277faf1
commit
1073f0b423
4 changed files with 98 additions and 28 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "dir_access_jandroid.h"
|
||||
#include "core/print_string.h"
|
||||
#include "file_access_jandroid.h"
|
||||
#include "string_android.h"
|
||||
#include "thread_jandroid.h"
|
||||
|
||||
jobject DirAccessJAndroid::io = NULL;
|
||||
|
@ -69,7 +70,7 @@ String DirAccessJAndroid::get_next() {
|
|||
if (!str)
|
||||
return "";
|
||||
|
||||
String ret = String::utf8(env->GetStringUTFChars((jstring)str, NULL));
|
||||
String ret = jstring_to_string((jstring)str, env);
|
||||
env->DeleteLocalRef((jobject)str);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue