canvas.Window: Do not delete canvas on close if other placements exist.
This commit is contained in:
parent
c8a5c507bc
commit
7bf96db691
1 changed files with 14 additions and 4 deletions
|
@ -26,14 +26,24 @@ var Window = {
|
|||
# Destructor
|
||||
del: func
|
||||
{
|
||||
me._node.remove();
|
||||
me._node = nil;
|
||||
|
||||
if( me["_canvas"] != nil )
|
||||
{
|
||||
me._canvas.del();
|
||||
var placements = me._canvas.texture.getChildren("placement");
|
||||
# Do not remove canvas if other placements exist
|
||||
if( size(placements) > 1 )
|
||||
foreach(var p; placements)
|
||||
{
|
||||
if( p.getValue("type") == "window"
|
||||
and p.getValue("id") == me.get("id") )
|
||||
p.remove();
|
||||
}
|
||||
else
|
||||
me._canvas.del();
|
||||
me._canvas = nil;
|
||||
}
|
||||
|
||||
me._node.remove();
|
||||
me._node = nil;
|
||||
},
|
||||
# Create the canvas to be used for this Window
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue