Code Review Request for CR 7128738 (original) (raw)

Code Review Request for CR 7128738 - dragged dialog freezes system on dispose

Anthony Petrov anthony.petrov at oracle.com
Tue Mar 13 19:16:13 PDT 2012


Hi Oleg,

The fix looks good to me. It would be cool to write a regression test for the issue, btw. You could start dragging a frame using Robot, and then call dispose() a couple seconds before releasing a mouse button. The test would fail by time-out w/o the fix.

-- best regards, Anthony

On 3/14/2012 1:54 AM, Oleg Pekhovskiy wrote:

Hi guys,

please review the fix for: http://bugs.sun.com/viewbug.do?bugid=7128738 webrev: http://cr.openjdk.java.net/~bagiras/7128738.1 Description: Entering 'move window' mode clicking window title bar sends WMSYSCOMMAND with SCMOVE inside WMNCLBUTTONDOWN. As a result additional message pump (for mouse capture) is created blocking the handlers' chain WMNCLBUTTONDOWN -> WMSYSCOMMAND. So when JFrame.dispose() is called during this situation, deleting of native AwtFrame object could NOT be done because AwtComponent::CanBeDeleted() returns FALSE (because of WMNCLBUTTONDOWN & WMSYSCOMMAND) and WMAWTDELETEOBJECT message is reposted over and over again (eating CPU time). Thus I added ReleaseDragCapture(0) to AwtComponent::Dispose() to release mouse capture and finish the additional message pump so that AwtComponent::CanBeDeleted() returns TRUE and AwtFrame object is deleted. Thanks, Oleg



More information about the awt-dev mailing list