Ensure canvas dialogs clean up all references to canvas ghosts on destruction
This commit is contained in:
parent
6612848745
commit
530db2e97a
2 changed files with 15 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue