Fix placements not being removed when destroying a canvas
Canvas placements are being added / removed through a listener on "placement" node adds / removals on the canvas's node. Previously, when the canvas's del method was called, the canvas's node was removed, but not its "placement" subnodes. This caused the canvas to be destroyed without the placements being removed. This in turn causes problems when setting up a canvas with the same placement(s). This is fixed by this commit by removing the "placement" nodes separately before destroying the canvas.
This commit is contained in:
parent
de7a49a456
commit
724fad6701
1 changed files with 4 additions and 0 deletions
|
@ -64,6 +64,10 @@ var Canvas = {
|
|||
#
|
||||
# releases associated canvas and makes this object unusable
|
||||
del: func {
|
||||
# explicitly remove placement nodes. This should in principle not
|
||||
# be required (since _node.remove() should also clean them up)
|
||||
me._node.removeChildren("placement");
|
||||
|
||||
me._node.remove();
|
||||
me.parents = nil; # ensure all ghosts get destroyed
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue