This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When profiling New Action apisupport wizard, I found out that there is org.openide.explorer.ExplorerManager and related objects leaking via the following reference path: sun.awt.X11.XToolkitThreadBlockedHandler.tk-> sun.awt.X11.XToolkit@18e2b22-> java.awt.Toolkit$ToolkitEventMulticaster@1d9d839-> java.awt.Toolkit$ToolkitEventMulticaster@1cf633f-> java.awt.Toolkit$SelectiveAWTEventListener@68b475-> org.openide.util.AsyncInitSupport@1e356a5-> org.netbeans.modules.project.ui.TemplateChooserPanelGUI@1636bbf-> org.netbeans.modules.project.ui.TemplatesPanelGUI@11c7768-> org.netbeans.modules.project.ui.TemplatesPanelGUI$CategoriesPanel@18d21f-> org.openide.explorer.ExplorerManager@8b063 Debugging the code in AsyncInitSupport I realized that it attaches the AWTEventListener in its constructor, but its method eventDispatched() never gets through the condition SwingUtilities.isDescendingFrom(comp4Init, (Component) (event.getSource())) and thus detach() called in start() is never run. The reason is IMHO that the TemplatesChooserPanelGUI never gets inside NbDialog instance which is here as the value of event.getSource(). I am not sure where the fix should be. I want to talk to Jirka about it, but I believe this issue belongs to org.netbeans.modules.project.ui.
Created attachment 27807 [details] Call stack of AsyncInitSupport constructor where AWTEventListener is attached
Changing summary from NewFileWizard leaks ExplorerManager if run with predefined file type to NewFileWizard leaks TemplateChooserPanelGUI if run with predefined file type because TemplateChooserPanelGUI is the closest object to where the leak is held (the nondetached AWTEventListener). However, the summary of the issue is not important, the leak is what matters here. :)
Closed as duplicate. A new one has fixed attachments due to this problem: issue #70577 *** This issue has been marked as a duplicate of 70579 ***
*** Issue 70579 has been marked as a duplicate of this issue. ***
closed