Skip to content

Commit

Permalink
ANDROID: Delay deleting a local ref until it's no longer used
Browse files Browse the repository at this point in the history
Should fix bug #6741
  • Loading branch information
Matthew Hoops committed Nov 22, 2014
1 parent 87ef1c3 commit 3c07243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backends/platform/android/asset-archive.cpp
Expand Up @@ -295,7 +295,6 @@ AssetFdReadStream::AssetFdReadStream(JNIEnv *env, jobject assetfd) :
jclass cls = env->GetObjectClass(_assetfd);
MID_close = env->GetMethodID(cls, "close", "()V");
assert(MID_close);
env->DeleteLocalRef(cls);

jmethodID MID_getStartOffset =
env->GetMethodID(cls, "getStartOffset", "()J");
Expand All @@ -321,6 +320,8 @@ AssetFdReadStream::AssetFdReadStream(JNIEnv *env, jobject assetfd) :

_fd = env->GetIntField(javafd, FID_descriptor);
env->DeleteLocalRef(javafd);

env->DeleteLocalRef(cls);
}

AssetFdReadStream::~AssetFdReadStream() {
Expand Down

0 comments on commit 3c07243

Please sign in to comment.