cc.loader.load(picUrl, (err, loadedTexture:cc.Texture2D) => {BUG

cc.loader.load(“http://192.168.1.8:36560/upload/gameuserid-683199-2018-9-18-15-30-12.jpg”, (err, loadedTexture:cc.Texture2D) => {

this.picViewList[index].spriteFrame.setTexture(loadedTexture);

加载远程资源BUG,
第一次游戏启动加载图片正确显示

重新打开游戏界面面板
报错
[ERROR]: Error 4914, please go to https://github.com/cocos-creator/engine/blob/master/EngineErrorMap.md#4914 to see details. Arguments: http://192.168.1.8:36560/upload/gameuserid-683199-2018-9-18-15-30-12.jpg
后来怀疑是资源释放问题,然后关闭面板时调用
加入 cc.loader.release(loadedTexture);
无效,一样的效果
然后试试其他接口
cc.loader.releaseRes(“http://192.168.1.8:36560/upload/gameuserid-683199-2018-9-18-15-30-12.jpg”);
也不行

creator 版本1.8.2

手机:ipad

没事了,找到解决办法了

cc.loader.load(picUrl, (err, loadedTexture:cc.Texture2D) => {
if (!err) {
Logger.log(“loadAndShowUrlPic========picUrl==”, picUrl);
Logger.log(“loadAndShowUrlPic=====index=”, index);
this.picViewList[index].spriteFrame = new cc.SpriteFrame(loadedTexture);
if(loadedTexture.width >= loadedTexture.height){ //拉伸高
this.picViewList[index].node.width = this.Photo_Width;
this.picViewList[index].node.height = this.Photo_Height* loadedTexture.height/loadedTexture.width;
}else{ //拉伸宽
this.picViewList[index].node.width = this.Photo_Width*loadedTexture.width/loadedTexture.height;
this.picViewList[index].node.height = this.Photo_Height
}
}
else {
cc.log(“加载失败”, err);
}
});

合法的应该这么写