NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Hermann Matthes Posted via mailing list.
|
Posted: Fri Jul 13, 2012 2:11 pm Post subject: [platform-dev] Question about non-singleton TopComponent |
|
|
Hello,
I have a non-singleton TopComponent which displays items in an outline
view. The users enters query criteria in a query dialog and when the
result is received from the server, a fresh TopComponent is created and
opened.
The OutlineView is filled using the following statement:
explorerManager.setRootContext(new AbstractNode(Children.create(new
ItemChildFactory(items), true)));
I create a child factory (ItemChildFactory), which automatically
registers itself at an EventNotifier (The EventNotifier uses
WeakReferences for the listenerList).
When the user closes the TopComponent,
explorerManager.setRootContext(Node.EMPTY);
is called in TopComponent.componentClosed()
I thought, that this causes the garbage collector to remove the child
factory. But a trace shows, that the EventNotifier still informs the
child factory about new events.
Can anybody tell me what to do to destroy the child factory ?
Thanks in advance
Hermann |
|
| Back to top |
|
 |
Jockey10
Joined: 06 Nov 2009 Posts: 10
|
Posted: Sat Jul 14, 2012 6:21 am Post subject: |
|
|
Could you just recreate the ExplorerManager instance instead of emptying the children? ie;
| Code: | | explorerManager = new ExplorerManager(); |
Or is that going to create more issues? |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|