Bug 537046 - IMenuService.populateContributionManager leaks contributions
Summary: IMenuService.populateContributionManager leaks contributions
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-15 14:53 EDT by Andrey Loskutov CLA
Modified: 2020-08-26 06:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2018-07-15 14:53:03 EDT
Side effect of bug 366528, found while trying to fix memory leaks via bug 536677.

org.eclipse.ui.menus.IMenuService.populateContributionManager(ContributionManager, String) leaks contributions if the given manager is used later to contribute other menus/toolbars.

One example is in SDK.

Put conditional breakpoint with condition condition managerToModel.get(manager) != null at  org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.linkModelToManager(MMenu, MenuManager) and also at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer.linkModelToManager(MToolBar, ToolBarManager).

Those breakpoint will hit by creating Problems view, because it uses populateContributionManager() on init() (creating first manager<->model link in both renderers) and overrides that link in createPartControl(IWorkbenchPart, Composite) later by registering *another* menu/toolbar models. The former model leaks on part/window closing.
Comment 1 Eclipse Genie CLA 2020-08-26 06:12:27 EDT
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.