Kaydet (Commit) dcc7a9f5 authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Tomaž Vajngerl

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
üst db682ae5
...@@ -192,6 +192,8 @@ AndroidSalInstance::AndroidSalInstance( SalYieldMutex *pMutex ) ...@@ -192,6 +192,8 @@ AndroidSalInstance::AndroidSalInstance( SalYieldMutex *pMutex )
AndroidSalInstance::~AndroidSalInstance() AndroidSalInstance::~AndroidSalInstance()
{ {
int res = (lo_get_javavm())->DetachCurrentThread();
LOGI("DetachCurrentThread res=%d", res);
LOGI("destroyed Android Sal Instance"); LOGI("destroyed Android Sal Instance");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment