When assigning different audio handles to the same variable, as shown below, does the previous audio reference need to be disposed of before the variable gets a new assignment? Or does reassigning the variable clear the reference?
--Would this commented-out code be necessary to avoid a memory leak? --this loops every half-second or so --if mainGroup.footChannel ~= nil then --audio.stop(mainGroup.footChannel) --audio.dispose(mainGroup.footChannel); mainGroup.footChannel=nil --end local n = math.random(1,4) mainGroup.footChannel = audio.play(footSoundTable[n])
Thanks.