From fb5036b7f12dd648340aaa7f90245afd353759e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 29 Oct 2013 17:40:56 +0100 Subject: Android: Fix problem with leaking local refs. In some cases we where not releasing the local references and since we no longer disconnect from the VM on each call, the number of local refs. would accumulating until it hit the hard-limit of 512. Change-Id: I6826620e4cb61a37af26d276667489e876080076 Reviewed-by: Yoann Lopes --- src/corelib/kernel/qjnihelpers.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/kernel/qjnihelpers.cpp') diff --git a/src/corelib/kernel/qjnihelpers.cpp b/src/corelib/kernel/qjnihelpers.cpp index fbcd0606e6..9ec491f6a9 100644 --- a/src/corelib/kernel/qjnihelpers.cpp +++ b/src/corelib/kernel/qjnihelpers.cpp @@ -94,7 +94,9 @@ jint QtAndroidPrivate::initJNI(JavaVM *vm, JNIEnv *env) return JNI_ERR; g_jClassLoader = env->NewGlobalRef(classLoader); + env->DeleteLocalRef(classLoader); g_jActivity = env->NewGlobalRef(activity); + env->DeleteLocalRef(activity); g_javaVM = vm; return JNI_OK; -- cgit v1.2.3