diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-04-02 11:01:48 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-04-02 11:02:31 -0400 |
commit | 1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f (patch) | |
tree | 105579e1a6d711eee76500a5cb29ac69bf8e4745 | |
parent | 8c9186f8d0fbe703a2d65541301051e2fa730c20 (diff) | |
download | eclipse.platform.swt-1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f.tar.gz eclipse.platform.swt-1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f.tar.xz eclipse.platform.swt-1e5d90e101ef7cd92d8b669df51a4e5957ebbc9f.zip |
Bug 375790 - [SWT_AWT] Hangs on quit on Mac OS X Lion
-rw-r--r-- | examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java index ba78a70663..83cd73e86e 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet337.java @@ -11,6 +11,7 @@ import java.awt.BorderLayout; import java.awt.Canvas; import java.awt.EventQueue; import java.awt.FlowLayout; +import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; @@ -64,7 +65,19 @@ public static void main(String args[]) { mainFrame.setVisible(true); } }); - while (true) { + display.addListener(SWT.Close, new Listener() { + public void handleEvent(Event event) { + EventQueue.invokeLater(new Runnable() { + public void run() { + Frame[] frames = JFrame.getFrames(); + for (int i = 0; i < frames.length; i++) { + frames[i].dispose(); + } + } + }); + } + }); + while (!display.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } |