1
0
Fork 0

Ensure canvas dialogs clean up all references to canvas ghosts on destruction

This commit is contained in:
Thomas Geymayer 2013-01-01 13:16:19 +01:00
parent 6612848745
commit 530db2e97a
2 changed files with 15 additions and 0 deletions

View file

@ -753,6 +753,14 @@ var Canvas = {
getPath: func()
{
return "canvas://by-index/texture[" ~ me.texture.getIndex() ~ "]";
},
# Destructor
#
# releases associated canvas and makes this object unusable
del: func
{
me.texture.remove();
me.parents = nil; # ensure all ghosts get destroyed
}
};

View file

@ -15,6 +15,13 @@ var Dialog = {
return m;
},
# Destructor
del: func
{
me.parents[1].del();
if( me["_canvas"] != nil )
me._canvas.del();
},
# Create the canvas to be used for this dialog
#
# @return The new canvas