Merge pull request #5641 from sanikoyes/Pr-fix-android-crash
Fix crash in FileAccessJAndroid::file_exists (does not free local ref)
This commit is contained in:
commit
f82e7d3a97
@ -182,8 +182,10 @@ bool FileAccessJAndroid::file_exists(const String& p_path) {
|
|||||||
|
|
||||||
jstring js = env->NewStringUTF(path.utf8().get_data());
|
jstring js = env->NewStringUTF(path.utf8().get_data());
|
||||||
int res = env->CallIntMethod(io,_file_open,js,false);
|
int res = env->CallIntMethod(io,_file_open,js,false);
|
||||||
if (res<=0)
|
if (res<=0) {
|
||||||
|
env->DeleteLocalRef(js);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
env->CallVoidMethod(io,_file_close,res);
|
env->CallVoidMethod(io,_file_close,res);
|
||||||
env->DeleteLocalRef(js);
|
env->DeleteLocalRef(js);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user