bundle.releaseAll

版本:cocos creator 2.4.3

源码:
let bundle = GL.bundleManager.getBundleByName(GL.roomConst.sceneName);
if (bundle) bundle.releaseAll();
if (bundle) cc.assetManager.removeBundle(bundle);

报错:Uncaught TypeError: Cannot read property ‘releaseAll’ of undefined

不知道是啥原因,有一定几率会出现这个错,并且会闪退

bundle 已经验证过了,是存在的

你这个验证不严谨啊,if(bundle) 这个bundle只要不是false、null、undefined、0; if(bundle)就算成立

let bundle = GL.bundleManager.getBundleByName(GL.roomConst.sceneName);
查这个吧 会DEBUG不- - 调试下就知道问题所在了