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.

Bug 70364 - NewFileWizard leaks TemplateChooserPanelGUI if run with predefined file type
Summary: NewFileWizard leaks TemplateChooserPanelGUI if run with predefined file type
Status: CLOSED DUPLICATE of bug 70579
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 70032
  Show dependency tree
 
Reported: 2005-12-13 22:44 UTC by Antonin Nebuzelsky
Modified: 2005-12-19 13:45 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Call stack of AsyncInitSupport constructor where AWTEventListener is attached (3.61 KB, text/plain)
2005-12-13 22:48 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2005-12-13 22:44:28 UTC
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.
Comment 1 Antonin Nebuzelsky 2005-12-13 22:48:06 UTC
Created attachment 27807 [details]
Call stack of AsyncInitSupport constructor where AWTEventListener is attached
Comment 2 Antonin Nebuzelsky 2005-12-13 23:01:38 UTC
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. :)
Comment 3 Michal Mocnak 2005-12-19 10:20:22 UTC
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 ***
Comment 4 Jan Lahoda 2005-12-19 10:21:53 UTC
*** Issue 70579 has been marked as a duplicate of this issue. ***
Comment 5 Marian Mirilovic 2005-12-19 13:45:56 UTC
closed