fix: more aggressive memory management
This commit is contained in:
parent
a2246f9bc7
commit
ee59bc988b
10 changed files with 15 additions and 13 deletions
|
@ -23,8 +23,8 @@
|
|||
|
||||
local Widget = {}
|
||||
|
||||
BaseWidget = Object:extend()
|
||||
TextWidget = BaseWidget:extend()
|
||||
local BaseWidget = Object:extend()
|
||||
local TextWidget = BaseWidget:extend()
|
||||
|
||||
-- INIT FUNCTIONS
|
||||
-- Initialize and configure the widget
|
||||
|
|
|
@ -54,6 +54,7 @@ function SceneManager:setStoredScene(name)
|
|||
if storedScene ~= nil then
|
||||
self.currentScene = storedScene
|
||||
self.storage[name] = nil
|
||||
collectgarbage()
|
||||
self.currentScene:restored()
|
||||
end
|
||||
end
|
||||
|
@ -73,6 +74,7 @@ function SceneManager:update(dt)
|
|||
if (self.nextScene ~= nil) then
|
||||
self.currentScene = self.nextScene
|
||||
self.nextScene = nil
|
||||
collectgarbage()
|
||||
end
|
||||
|
||||
if (self.currentScene ~= nil) then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
AbstractMobParent = require "game.abstractmobs.parent"
|
||||
local AbstractMobParent = require "game.abstractmobs.parent"
|
||||
|
||||
AbstractCharacter = AbstractMobParent:extend()
|
||||
local AbstractCharacter = AbstractMobParent:extend()
|
||||
|
||||
local charutils = require "game.utils.characters"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
AbstractMobParent = require "game.abstractmobs.parent"
|
||||
local AbstractMobParent = require "game.abstractmobs.parent"
|
||||
|
||||
AbstractEnnemy = AbstractMobParent:extend()
|
||||
local AbstractEnnemy = AbstractMobParent:extend()
|
||||
|
||||
local ennutils = require "game.utils.ennemies"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
EventUtils = {}
|
||||
local EventUtils = {}
|
||||
|
||||
-- steps utils
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Scene = require("core.modules.scenes")
|
||||
local Scene = require("core.modules.scenes")
|
||||
local PlayStyle = Scene:extend()
|
||||
|
||||
local PauseMenu = require("game.modules.subgames.pause")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
BattleUtils = {}
|
||||
local BattleUtils = {}
|
||||
|
||||
local datasutils = require "game.utils.datas"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ChoregraphyUtils = {}
|
||||
local ChoregraphyUtils = {}
|
||||
|
||||
-- steps utils
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
DataUtils = {}
|
||||
local DataUtils = {}
|
||||
|
||||
local DATADIR = "datas"
|
||||
local GAMEDATADIR = "gamedata"
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
]]
|
||||
|
||||
Core = require "core"
|
||||
Game = require "game"
|
||||
local Core = require "core"
|
||||
local Game = require "game"
|
||||
|
||||
scenes = require "scenes"
|
||||
|
||||
|
|
Loading…
Reference in a new issue