I noticed the problem was with Menu and MenuItems never getting disposed by using a profiler.
Now what I did was to extend ChartComposite and create a method removeAllMenuItems() which goes like this:
Code: Select all
public void removeAllMenuItems() {
if (popupMenu != null) {
for (MenuItem menuItem : popupMenu.getItems()) {
menuItem.removeSelectionListener(this);
menuItem.dispose();
}
popupMenu.dispose();
}
}
Is there a better method to do this? I currently working with 1.0.19 but maybe you guys have something better in store for the next version.