Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-426

Memory leak in RuleHelperActionDelegate

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.4
    • None
    • drools-eclipse
    • None

    Description

      The class RuleHelperActionDelegate ( svn) has a memory leak. Specifically:

      the Delegate itself is responsible for deleting any and all created Menu widgets. In the current implementation, the getMenu(Control) method is as follows:

      Menu menu = new Menu( parent );
      final Shell shell = parent.getShell();
      addProjectWizard( menu, shell );
      addRuleWizard( menu,shell );
      addDSLWizard( menu, shell );
      addDTWizard( menu,shell );
      return menu;

      Clearly, new menu widgets are created each time and are never disposed of. A correct implementation of this interface is available at org.eclipse.wst.server.ui.internal.webbrowser.SwitchBrowserWorkbenchAction . Specifically, the getMenu(Control) method should first dispose of the last menu, then create the new ones.

      public Menu getMenu(Control parent)

      { setMenu(new Menu(parent)); //fillMenu(fMenu); initMenu(); return fMenu; }

      private void setMenu(Menu menu) {
      if (fMenu != null)

      { fMenu.dispose(); }

      fMenu = menu;
      }

      So... ... ... he needs to destroy his menus before creating new ones =]

      Attachments

        Activity

          People

            kverlaen@redhat.com Kris Verlaenen
            kverlaen@redhat.com Kris Verlaenen
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty