mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-19 15:39:09 +00:00
7045174: Most of the tests in awt area fails with jdk 7b142 on windows with -Xcheck:jni
Reviewed-by: art, denis
This commit is contained in:
parent
7f5de78e6f
commit
df0aefd4ae
@ -69,9 +69,12 @@ void AwtObject::_Dispose(jobject self)
|
||||
|
||||
CriticalSection::Lock l(AwtToolkit::GetInstance().GetSyncCS());
|
||||
|
||||
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
|
||||
jobject selfGlobalRef = env->NewGlobalRef(self);
|
||||
|
||||
// value 0 of lParam means that we should not attempt to enter the
|
||||
// SyncCall critical section, as it was entered someshere earlier
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)self, (LPARAM)0);
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)selfGlobalRef, (LPARAM)0);
|
||||
|
||||
CATCH_BAD_ALLOC;
|
||||
}
|
||||
|
||||
@ -741,7 +741,9 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
|
||||
}
|
||||
if (canDispose) {
|
||||
if(wParam != NULL) {
|
||||
AwtObject *o = (AwtObject *) JNI_GET_PDATA((jobject)wParam);
|
||||
jobject self = (jobject)wParam;
|
||||
AwtObject *o = (AwtObject *) JNI_GET_PDATA(self);
|
||||
env->DeleteGlobalRef(self);
|
||||
if(o != NULL && theAwtObjectList.Remove(o)) {
|
||||
o->Dispose();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user