summaryrefslogtreecommitdiff
path: root/vcl/android
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-10-15 12:02:44 +0300
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-12-04 23:04:21 +0100
commitdcc7a9f54f9c525d0efdff8f2142e03a5292bd83 (patch)
treebc70ebcabd734476b534d65c9fb9d53d4f1134fa /vcl/android
parentdb682ae56bfd7e09414e9aca41d89fa055ae07fd (diff)
Call DetachCurrentThread() in the AndroidSalInstance destructor
As we call AttachCurrentThread() in the constructor, it seems logical to call DetachCurrentThread() in the destructor. Some warning messages in the logcat indicated that DetachCurrentThread() hadn't been called for a thread that died. Actually I would prefer to call both AttachCurrentThread() and DetachCurrentThread() in the actual thread function, instead of somewhat haphazardly and imlicitly in the AndroidSalInstance constructor and destructor. Do we know for sure that the lifetime of the AndroidSalInstance singleton (is is a singleton, right?) is 1:1 coupled to that of the LO "main thread"? Change-Id: Ifcc0e0b9af88b19389c416c5646499d44ad0e941
Diffstat (limited to 'vcl/android')
-rw-r--r--vcl/android/androidinst.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 4bb391ce371d..172c72c6b453 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -192,6 +192,8 @@ AndroidSalInstance::AndroidSalInstance( SalYieldMutex *pMutex )
AndroidSalInstance::~AndroidSalInstance()
{
+ int res = (lo_get_javavm())->DetachCurrentThread();
+ LOGI("DetachCurrentThread res=%d", res);
LOGI("destroyed Android Sal Instance");
}