Is there any reason that SingleCDockables do not remove themselves from the CControl when the CloseAction is triggered? Right now close just calls setVisible(false). Over time this could lead to running out of memory.
MultipleCDockables have a setRemoveOnClose() flag that can be set for cleanup, adding that flag SingleCDockables probably makes sense.
Here is the logic I’m using the cleanup closed SingleCDockables
// when the CDockable is made not visible, remove it from the CControl
control.addStateListener(new CDockableAdapter(){
@Override
public void visibilityChanged(CDockable dockable) {
if (!dockable.isVisible() && dockable instanceof SingleCDockable){
control.remove((SingleCDockable) dockable);
}
}
});