Menu instances need to be disposed() in SWT

git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/ipscan@15 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
angryziber 2006-08-02 19:44:16 +00:00
parent 5602ae0567
commit 0788f78bf6

View File

@ -104,8 +104,10 @@ public class FeederActions {
Menu popupMenu = new Menu(Display.getCurrent().getActiveShell(), SWT.POP_UP);
Listener menuItemListener = new Listener() {
public void handleEvent(Event event) {
String address = (String) event.widget.getData();
MenuItem menuItem = (MenuItem) event.widget;
String address = (String) menuItem.getData();
ipText.setText(address);
menuItem.getParent().dispose();
}
};
@ -135,6 +137,7 @@ public class FeederActions {
Event event = new Event();
event.widget = popupMenu.getItem(0);
menuItemListener.handleEvent(event);
popupMenu.dispose();
}
// otherwise, unable to retrieve any sane local addresses,
// leave the field as-is, which probably shows the loopback address already