Results 1 to 2 of 2

Thread: GroupingHandlerRegistration and widgetMap in Container causing memory leak?

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-2376 in 3.0.2.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2011

    Default GroupingHandlerRegistration and widgetMap in Container causing memory leak?

    Myself and a co-worker have been investigating an issue with memory leaks in our application. Using the Developer Tools in Chrome, we've essentially come to the conclusion that the widgetMap created in ensureGroupingHandlerRegistration( Widget w) in the Container class is the root of the problem.

    Why is a private Map of the widget added to a Container created with absolutely no way of emptying out the contents of the Map?

    In our case, the Container is a ContentPanel that we remove the child Container panel of, then add a new child Container. Meaning the original ContentPanel doesn't go away, but the widgetMap keeps references to all previously added/inserted Widgets, regardless of whether or not the Widget is still a child of the ContentPanel.

    Here is a small test:

    ContentPanel p = new ContentPanel();
    ContentPanel child1 = new ContentPanel();
    ContentPanel child2 = new ContentPanel();

    p.add( child1 );
    p.remove( child1 );
    p.add( child2 );

    The widgetMap for p will still contain child1 even though it is no longer a child of p.

    By creating our own widgetMap in a subclass of ContentPanel, the problem goes away, but shouldn't the Container itself be cleaning up this widgetMap?


  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007


    Thanks for reporting. Yes this is a leak. I will move this to the bugs forum so we can fix it. Thanks for reporting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts