Fix Piano app (#991)

* Trying to reduce memory leaks

* Formalize the usage of pianoVK.ctrl and pianoVK.shift

* Replace all loop, make a text object list

* Add auto-garbage cleaner and remove 2 unnecessary variable

* Update app_piano.lua
This commit is contained in:
C6H12O6 + NaCl + H2O
2023-09-25 20:27:31 +07:00
committed by GitHub
parent bbb5fd7832
commit 19e4185668

View File

@@ -183,7 +183,13 @@ end
function scene.update(dt)
for _,key in pairs(pianoVK) do
key:update(dt)
key:update(nil,dt)
end
if lastKeyTime and keyCount>626 and TIME()-lastKeyTime>10 then
collectgarbage()
lastKeyTime=nil
keyCount=0
end
if lastKeyTime and keyCount>626 and TIME()-lastKeyTime>10 then