QJNI: Don't detach from the thread as long as the thread is alive.
authorChristian Strømme <christian.stromme@digia.com>
Thu, 24 Oct 2013 14:24:48 +0000 (16:24 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 25 Oct 2013 16:11:51 +0000 (18:11 +0200)
commit746f7a5b28d92d962ae261c52da4d750ea3b50f0
tree2d2acf3086a6693c82d6c8bad11a503e0851446e
parente1325cf26e146b68725cc1a0a02b274ce3dfbe5c
QJNI: Don't detach from the thread as long as the thread is alive.

Attaching and detaching the current thread to/from the VM on each jni call,
causes a new thread object to be created and triggers GC when detaching
(GC alone takes anything between 10-30 ms to finish on the test device).
Instead of detaching when the environment object goes out of scope, we
now detach when the thread exits.

Task-number: QTBUG-34279
Change-Id: Ia613934e61f914d4be63bfa1be8fdecf849928b0
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
src/corelib/kernel/qjni.cpp