6851688: Hung up in applet application

Reviewed-by: art, dcherepanov
This commit is contained in:
Alexey Utkin 2009-07-31 17:24:27 +04:00
parent f169709382
commit 426d2a0ee7
2 changed files with 4 additions and 4 deletions

View File

@ -1596,18 +1596,18 @@ void AwtToolkit::RegisterEmbedderProcessId(HWND embedder)
}
JNIEnv* AwtToolkit::m_env;
HANDLE AwtToolkit::m_thread;
DWORD AwtToolkit::m_threadId;
void AwtToolkit::SetEnv(JNIEnv *env) {
if (m_env != NULL) { // If already cashed (by means of embeddedInit() call).
return;
}
m_thread = GetCurrentThread();
m_threadId = GetCurrentThreadId();
m_env = env;
}
JNIEnv* AwtToolkit::GetEnv() {
return (m_env == NULL || m_thread != GetCurrentThread()) ?
return (m_env == NULL || m_threadId != GetCurrentThreadId()) ?
(JNIEnv*)JNU_GetEnv(jvm, JNI_VERSION_1_2) : m_env;
}

View File

@ -442,7 +442,7 @@ public:
private:
static JNIEnv *m_env;
static HANDLE m_thread;
static DWORD m_threadId;
public:
static void SetEnv(JNIEnv *env);
static JNIEnv* GetEnv();