修复bgm模块清缓存导致报错
This commit is contained in:
@@ -40,10 +40,17 @@ local function check_curFadeOut(task,code,src)
|
|||||||
return task.code==code and task.args[1]==src
|
return task.code==code and task.args[1]==src
|
||||||
end
|
end
|
||||||
local function _tryReleaseSources()
|
local function _tryReleaseSources()
|
||||||
|
local n=#lastLoaded
|
||||||
while #lastLoaded>maxLoadedCount do
|
while #lastLoaded>maxLoadedCount do
|
||||||
local n=lastLoaded[#lastLoaded]
|
local name=lastLoaded[n]
|
||||||
SourceObjList[n].source=SourceObjList[n].source:release()and nil
|
if SourceObjList[name].source:isPlaying()then
|
||||||
table.remove(lastLoaded)
|
n=n-1
|
||||||
|
if n<=0 then return end
|
||||||
|
else
|
||||||
|
SourceObjList[name].source=SourceObjList[name].source:release()and nil
|
||||||
|
table.remove(lastLoaded,n)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function BGM.setDefault(bgm)
|
function BGM.setDefault(bgm)
|
||||||
|
|||||||
Reference in New Issue
Block a user