Android: Fixed problems with memory leaks due to absent ReleaseStringUTFChars calls.

This commit is contained in:
Ivan Ponomarev 2019-02-26 23:54:45 +03:00
parent f0f277faf1
commit 1073f0b423
4 changed files with 98 additions and 28 deletions

View file

@ -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;
}