内存过低的提示每次启动最多出现三次

This commit is contained in:
MrZ626
2021-11-23 00:28:08 +08:00
parent 3c04df69f3
commit 36c8449e4d

View File

@@ -388,11 +388,11 @@ end
function love.directorydropped(dir)
if SCN.directoryDropped then SCN.directoryDropped(dir)end
end
local lastGCtime=0
local autoGCcount=0
function love.lowmemory()
if love.timer.getTime()-lastGCtime>6.26 then
collectgarbage()
lastGCtime=love.timer.getTime()
collectgarbage()
if autoGCcount<3 then
autoGCcount=autoGCcount+1
MES.new('check',"[auto GC] low MEM 设备内存过低")
end
end