/** remove this node from its parent; INVARIANT: whenever the parent of a node is changed, remove() gets called. */
public void remove() {
if (parent == null) {
- if (surface != null) surface.dispose();
+ if (surface != null) surface.dispose(true);
return;
}
Box oldparent = getParent();