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:
committed by
GitHub
parent
bbb5fd7832
commit
19e4185668
@@ -183,7 +183,13 @@ end
|
|||||||
|
|
||||||
function scene.update(dt)
|
function scene.update(dt)
|
||||||
for _,key in pairs(pianoVK) do
|
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
|
end
|
||||||
|
|
||||||
if lastKeyTime and keyCount>626 and TIME()-lastKeyTime>10 then
|
if lastKeyTime and keyCount>626 and TIME()-lastKeyTime>10 then
|
||||||
|
|||||||
Reference in New Issue
Block a user