Community
Participate
Working Groups
SWT 3232 Don't know how to reproduce it, but here is a stack trace anyway. org.eclipse.swt.SWTError: Item not added at org.eclipse.swt.SWT.error(SWT.java:3400) at org.eclipse.swt.SWT.error(SWT.java:3297) at org.eclipse.swt.SWT.error(SWT.java:3268) at org.eclipse.swt.widgets.Widget.error(Widget.java:435) at org.eclipse.swt.widgets.Menu.createItem(Menu.java:484) at org.eclipse.swt.widgets.MenuItem.<init>(MenuItem.java:129) at org.eclipse.jface.action.ActionContributionItem.fill(ActionContributionItem.java:267) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:627) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:549) at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:232) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:627) at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:373) at org.eclipse.jface.action.MenuManager.access$000(MenuManager.java:37) at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:386) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:117) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:933) at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:3556) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3272) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1539) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1634) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025) at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method) at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:225) at org.eclipse.swt.widgets.Display.runPopups(Display.java:3374) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2962)
This can happen when too many menus are creates (ie. you leak). You could try hacking the constructor for Menu and Menu.releaseHandle() to count the number of menus created and disposed.
I did as you proposed, but nothing is leaking according to this count. I don't experience the problem but it was reported to me so I'm not sure how to discover the real cause. They have experienced it many times. I suppose it could be more helpful if SWT used GetLastError() on win32 and appended the real error to all SWTErrors (FormatMessage) which seem rather opaque at the moment.
*** Bug 174636 has been marked as a duplicate of this bug. ***
Hmmm ... how about using Task Manager to track Handles, User Objects and GDI Objects. Do any of these grow without bounds?
Created attachment 99826 [details] stack eclipse.buildId=I20070625-1500 Eclipse Java 3.3.0 on Win XP One of our developers repeatedly encounters this SWTError during the day. There are two variations of it in this log. He says it happens frequently in the Java Debug perspective when popping up context menus.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.