Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 123003 | Differences between
and this patch

Collapse All | Expand All

(-)visualweb/designer/src/org/netbeans/modules/visualweb/designer/WebForm.java (-5 / +10 lines)
 Lines 72-77    Link Here 
72
import java.util.List;
72
import java.util.List;
73
import java.util.Map;
73
import java.util.Map;
74
74
75
import java.util.WeakHashMap;
75
import javax.swing.CellRendererPane;
76
import javax.swing.CellRendererPane;
76
import javax.swing.JComponent;
77
import javax.swing.JComponent;
77
import javax.swing.event.EventListenerList;
78
import javax.swing.event.EventListenerList;
 Lines 596-606    Link Here 
596
//        }
597
//        }
597
        // #106433 There needs to be 1:N mapping for  element : box.
598
        // #106433 There needs to be 1:N mapping for  element : box.
598
        // TODO Revise potential memory leak, boxes linked to the elements!
599
        // TODO Revise potential memory leak, boxes linked to the elements!
599
        Map<WebForm, CssBox> webform2box = (Map<WebForm, CssBox>)element.getUserData(KEY_CSS_BOX_MAP);
600
        Map<WebForm, WeakReference<CssBox>> webform2box = (Map<WebForm, WeakReference<CssBox>>)element.getUserData(KEY_CSS_BOX_MAP);
600
        if (webform2box == null) {
601
        if (webform2box == null) {
601
            webform2box = new HashMap<WebForm, CssBox>();
602
            // #123003 Avoiding possible leak, the insync FacesModel
603
            // is not garbaged unless the project is closed.
604
            webform2box = new WeakHashMap<WebForm, WeakReference<CssBox>>();
602
        }
605
        }
603
        webform2box.put(this, box);
606
        webform2box.put(this, new WeakReference<CssBox>(box));
604
        element.setUserData(KEY_CSS_BOX_MAP, webform2box, CssBoxDataHandler.getDefault());
607
        element.setUserData(KEY_CSS_BOX_MAP, webform2box, CssBoxDataHandler.getDefault());
605
    }
608
    }
606
    
609
    
 Lines 611-618    Link Here 
611
        if (element == null) {
614
        if (element == null) {
612
            return null;
615
            return null;
613
        }
616
        }
614
        Map<WebForm, CssBox> webform2box = (Map<WebForm, CssBox>)element.getUserData(KEY_CSS_BOX_MAP);
617
        Map<WebForm, WeakReference<CssBox>> webform2box = (Map<WebForm, WeakReference<CssBox>>)element.getUserData(KEY_CSS_BOX_MAP);
615
        return webform2box == null ? null : webform2box.get(this);
618
//        return webform2box == null ? null : webform2box.get(this);
619
        WeakReference<CssBox> cssBoxWRef = webform2box == null ? null : webform2box.get(this);
620
        return cssBoxWRef == null ? null : cssBoxWRef.get();
616
    }
621
    }
617
    
622
    
618
    // XXX Temporary, see DesignerService.copyBoxForElement.
623
    // XXX Temporary, see DesignerService.copyBoxForElement.

Return to bug 123003
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo