Added love.lowmemory event callback function, called when the app is close to running out of memory on iOS and Android.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-02-26 00:45:48 -04:00
parent e8ce59038f
commit 95f87ed886
3 changed files with 19 additions and 4 deletions
+6 -2
View File
@@ -211,7 +211,7 @@ function love.createhandlers()
joystickadded = function (j)
if love.joystickadded then return love.joystickadded(j) end
end,
joystickremoved = function(j)
joystickremoved = function (j)
if love.joystickremoved then return love.joystickremoved(j) end
end,
focus = function (f)
@@ -229,7 +229,7 @@ function love.createhandlers()
threaderror = function (t, err)
if love.threaderror then return love.threaderror(t, err) end
end,
resize = function(w, h)
resize = function (w, h)
if love.resize then return love.resize(w, h) end
end,
filedropped = function (f)
@@ -238,6 +238,10 @@ function love.createhandlers()
directorydropped = function (dir)
if love.directorydropped then return love.directorydropped(dir) end
end,
lowmemory = function ()
collectgarbage()
if love.lowmemory then return love.lowmemory() end
end,
}, {
__index = function(self, name)
error("Unknown event: " .. name)