fixed bug #41509 - memory leak BLD200405191800
authorrypacek@netbeans.org
Wed, 19 May 2004 14:13:10 +0000
changeset 46146f783cc2fafd
parent 4613 2f8f431133f1
child 4615 56032d150348
fixed bug #41509 - memory leak
tasklist.core/src/org/netbeans/modules/tasklist/core/TaskListNode.java
     1.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/TaskListNode.java	Wed May 19 13:00:17 2004 +0000
     1.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/TaskListNode.java	Wed May 19 14:13:10 2004 +0000
     1.3 @@ -21,6 +21,7 @@
     1.4  
     1.5  import java.util.Collections;
     1.6  import java.util.ArrayList;
     1.7 +import java.util.Enumeration;
     1.8  
     1.9  /**
    1.10   * Node visualization of TaskList. It creates children
    1.11 @@ -62,6 +63,16 @@
    1.12          Node createNode(Object task);
    1.13      }
    1.14  
    1.15 +    public void destroy() throws java.io.IOException {
    1.16 +        // explicitly destroy all children, it's not done automatically
    1.17 +        Enumeration en = getChildren().nodes();
    1.18 +        while (en.hasMoreElements()) {
    1.19 +            Node next = (Node) en.nextElement();
    1.20 +            next.destroy();
    1.21 +        }
    1.22 +        super.destroy();
    1.23 +    }    
    1.24 +    
    1.25      static class TaskListChildren extends Children.Keys implements TaskListener, Runnable {
    1.26  
    1.27          private ObservableList list;