Creator 2.0.9 频繁切换场景时,音频资源加载释放闪退(资源是批量加载,大概3.5M)

Cocoscreator 2.0.9版本


音乐预加载开始1 --释放已有资源[“Common/Sound/Music/music0”,“Common/Sound/Music/music1”,“Common/Sound/Music/music2”,“Common/Sound/Music/music3”,“Common/Sound/Music/music4”]
MyDebugger.ts:19 音乐预加载开始2 [“Common/Sound/blc_UI”,“Common/Sound/wancheng”,“Common/Sound/testBg/bgm_dating”,“Common/Sound/testBg/bgm_dating01”,“Common/Sound/testBg/bgm_dating02”,“Common/Sound/testBg/bgm_dating03”,“Common/Sound/testBg/bgm_dating04”]
MyDebugger.ts:19 isShowGuide false
MyDebugger.ts:19 推送余额 ChipsPush {change: n, chips: n, safeChips: n}
MyDebugger.ts:19 通过按钮名称显示或隐藏红点—> reliefBtn false
MyDebugger.ts:19 通过按钮名称显示或隐藏红点—> mailBtn true
MyDebugger.ts:19 通过按钮名称显示或隐藏红点—> activityBtn false
MyDebugger.ts:19 通过按钮名称显示或隐藏红点—> gonggaoBtn false
5callbacks-invoker.js:243 Uncaught TypeError: Cannot read property ‘load’ of null
at cc_AudioClip.174.CallbacksInvoker.invoke (callbacks-invoker.js:243)
at cc_AudioClip.set [as _nativeAsset] (CCAudioClip.js:74)
at Object.loadCallback (uuid-loader.js:137)
at uuid-loader.js:157
at LoadingItems.onComplete (CCLoader.js:314)
at LoadingItems.122.proto.allComplete (loading-items.js:529)
at LoadingItems.122.proto.itemComplete (loading-items.js:721)
at Function.122.LoadingItems.itemComplete (loading-items.js:379)
at CCLoader.125.proto.flowOut (pipeline.js:319)
at flow (pipeline.js:87)
174.CallbacksInvoker.invoke @ callbacks-invoker.js:243
set @ CCAudioClip.js:74
loadCallback @ uuid-loader.js:137
(anonymous) @ uuid-loader.js:157
(anonymous) @ CCLoader.js:314
122.proto.allComplete @ loading-items.js:529
122.proto.itemComplete @ loading-items.js:721
122.LoadingItems.itemComplete @ loading-items.js:379
125.proto.flowOut @ pipeline.js:319
flow @ pipeline.js:87
(anonymous) @ pipeline.js:64
(anonymous) @ downloader.js:266
(anonymous) @ audio-downloader.js:85
MyDebugger.ts:19 音乐预加载完成回调

2赞

能不能给个demo看下?

代码大概是这样,晚点我整一个出来!

Music.zip (1.2 MB)
music1.zip (2.1 MB)
这两个音频资源放在一起加载的时候

谢谢反馈,我看下。

另外我需要了解一下,你这里描述的频繁切换操作,平均需要切换几次场景能够复现?

我在本地没有复现这个问题,原因是我这边没能正确模拟你的项目,还请你提供一个能够复现问题的demo给我,感谢你的反馈。

官方很多的时候,测试用的可能是mac,建议用windows测测。。。

我们会在两个环境下进行测试的。

不好意思,前面描述不是很准确,其实不是切场景,就是layer之间的频繁切换,是在win32环境上出现的,真机居然没有问题!

就是很快速的创建和销毁音频,5,6次就会出现,3,4次也是有可能的!