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 104330

Summary: AbstractJsfTopComponent$CBListener memory leak
Product: obsolete Reporter: Quy Nguyen <quynguyen>
Component: visualwebAssignee: Peter Zavadsky <pzavadsky>
Status: RESOLVED FIXED    
Severity: blocker Keywords: PERFORMANCE
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 104386    
Bug Blocks:    

Description Quy Nguyen 2007-05-18 23:26:23 UTC
In some cases, the AbstractJsfTopComponent$CBListener clipboard listener is not
unregistered from the NbClipboard object.

The componentDeactivated() method in JsfTopComponent is only called if the
design tab is selected when the component is closed.  If the java or jsp tabs
are selected, only componentClosed() is called, which does not unregister the
clipboard listener.
Comment 1 Peter Zavadsky 2007-05-21 08:25:59 UTC
The problem seems to be that when switching within multiview only the
componentActivated is called, but not the componentDeactivated. First filling a
bug against multiview impl.
Comment 2 Peter Zavadsky 2007-05-21 08:31:43 UTC
Created the issue #104386, the componentDeactivated is not called.

However I am gonna try to workaround this impl using weak listeners (same is
used in ExplorerActionsImpl), so the problem doesn't persist after closing the
component.
Comment 3 Peter Zavadsky 2007-05-21 09:11:42 UTC
Fixed:

Now the listener is made weak, so it shouldn't cause the memory leak anymore.

Checking in
visualweb/designer/jsf/src/org/netbeans/modules/visualweb/designer/jsf/ui/AbstractJsfTopComponent.java;
/cvs/visualweb/designer/jsf/src/org/netbeans/modules/visualweb/designer/jsf/ui/AbstractJsfTopComponent.java,v
 <--  AbstractJsfTopComponent.java
new revision: 1.7; previous revision: 1.6
done