diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-08 17:33:28 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-08 17:33:28 +0200 |
commit | 4faecfbd6495c46c2d93ce314252feeb7879e568 (patch) | |
tree | 3ab7b92e97223f2276ad3a81d9c8f25fe18f79b7 /not/SceneManager.lua | |
parent | 5ef20afaf6a9aca1999faf8904594d94fcfaaa66 (diff) | |
download | roflnauts-4faecfbd6495c46c2d93ce314252feeb7879e568.zip roflnauts-4faecfbd6495c46c2d93ce314252feeb7879e568.tar.gz roflnauts-4faecfbd6495c46c2d93ce314252feeb7879e568.tar.bz2 |
Some additional garbage collecting
Diffstat (limited to 'not/SceneManager.lua')
-rw-r--r-- | not/SceneManager.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/not/SceneManager.lua b/not/SceneManager.lua index c076448..4f9edfd 100644 --- a/not/SceneManager.lua +++ b/not/SceneManager.lua @@ -9,7 +9,10 @@ end -- This function should be removed when multiple scenes will be handled properly by SceneManager and other things. function SceneManager:changeScene (scene) - table.remove(self.scenes, #self.scenes) + local removed = table.remove(self.scenes, #self.scenes) + if removed then + removed:delete() + end return self:addScene(scene) end @@ -20,7 +23,8 @@ end -- Not nice, not nice. function SceneManager:removeTopScene () - table.remove(self.scenes, #self.scenes) + local scene = table.remove(self.scenes, #self.scenes) + scene:delete() end function SceneManager:getAllScenes () |