diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-07-12 07:26:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-12 07:26:53 +0200 |
commit | f82e7d3a97431107b7581dc27f19912b12d3fb68 (patch) | |
tree | ecc267019584b5fc68732356384a3a40b51aea12 | |
parent | 480ac2bcfbe114d402cf5279ba392e709d378a24 (diff) | |
parent | 978cb0e884dea9be4d98a0b52ae930655f7d9ad8 (diff) |
Merge pull request #5641 from sanikoyes/Pr-fix-android-crash
Fix crash in FileAccessJAndroid::file_exists (does not free local ref)
-rw-r--r-- | platform/android/file_access_jandroid.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp index da8ceaff14..ea33e9a67b 100644 --- a/platform/android/file_access_jandroid.cpp +++ b/platform/android/file_access_jandroid.cpp @@ -182,8 +182,10 @@ bool FileAccessJAndroid::file_exists(const String& p_path) { jstring js = env->NewStringUTF(path.utf8().get_data()); int res = env->CallIntMethod(io,_file_open,js,false); - if (res<=0) + if (res<=0) { + env->DeleteLocalRef(js); return false; + } env->CallVoidMethod(io,_file_close,res); env->DeleteLocalRef(js); return true; |