Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8252470: java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.…
…java fails on Windows

Reviewed-by: serb, prr
  • Loading branch information
Dmitry Markov committed Aug 29, 2020
1 parent 2289fbb commit a7d1a64cb610289a88969ec0aa248dec6de22ee7
@@ -3211,10 +3211,20 @@ BOOL AwtToolkit::TICloseTouchInputHandle(HTOUCHINPUT hTouchInput) {
* instead of SendMessage().
*/
LRESULT AwtToolkit::InvokeInputMethodFunction(UINT msg, WPARAM wParam, LPARAM lParam) {
CriticalSection::Lock lock(m_inputMethodLock);
if (PostMessage(msg, wParam, lParam)) {
::WaitForSingleObject(m_inputMethodWaitEvent, INFINITE);
return m_inputMethodData;
/*
* DND runs on the main thread. So it is necessary to use SendMessage() to call an IME
* function once the DND is active; otherwise a hang is possible since DND may wait for
* the IME completion.
*/
if (isInDoDragDropLoop) {
return SendMessage(msg, wParam, lParam);
} else {
CriticalSection::Lock lock(m_inputMethodLock);
if (PostMessage(msg, wParam, lParam)) {
::WaitForSingleObject(m_inputMethodWaitEvent, INFINITE);
return m_inputMethodData;
}
return 0;
}
return 0;
}

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
/**
* @test
* @summary JVM crash if the frame is disposed in DropTargetListener
* @bug 8252470
* @key headful
* @author Petr Pchelko
* @library ../../regtesthelpers

0 comments on commit a7d1a64

Please sign in to comment.