Menu

#91 CompositeFigure.removeAll()

open
nobody
None
5
2004-03-13
2004-03-13
Anonymous
No

CompositeFigure.removeAll() does not call release() for
the removed figures. It only removes the figures from
the current container but doesn't fire events to inform
other containers about the removed figures by calling
release().

Original:
public void removeAll() {
FigureEnumeration fe = figures();
while (fe.hasNextFigure()) {
Figure figure = fe.nextFigure();
figure.removeFromContainer(this);
}
fFigures.clear();

_clearQuadTree();
_nLowestZ = 0;
_nHighestZ = 0;
}

Should be:
public void removeAll() {
FigureEnumeration fe = figures();
while (fe.hasNextFigure()) {
Figure figure = fe.nextFigure();
figure.removeFromContainer(this);
figure.release(); // ****
Missing above
}
fFigures.clear();

_clearQuadTree();
_nLowestZ = 0;
_nHighestZ = 0;
}

:-) Holger

Discussion


Log in to post a comment.

MongoDB Logo MongoDB