mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14197 from xiaofeng11/v3_xf
Fix CCDownloader-curl will crash in js-test & Fix broken image link in TextureCacheTest.js
This commit is contained in:
commit
175f4c02ad
|
@ -779,6 +779,12 @@ namespace cocos2d { namespace network {
|
||||||
|
|
||||||
// update finished tasks
|
// update finished tasks
|
||||||
_impl->getFinishedTasks(tasks);
|
_impl->getFinishedTasks(tasks);
|
||||||
|
|
||||||
|
if (_impl->stoped())
|
||||||
|
{
|
||||||
|
_scheduler->pauseTarget(this);
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& wrapper : tasks)
|
for (auto& wrapper : tasks)
|
||||||
{
|
{
|
||||||
const DownloadTask& task = *wrapper.first;
|
const DownloadTask& task = *wrapper.first;
|
||||||
|
@ -844,11 +850,6 @@ namespace cocos2d { namespace network {
|
||||||
onTaskFinish(task, coTask._errCode, coTask._errCodeInternal, coTask._errDescription, coTask._buf);
|
onTaskFinish(task, coTask._errCode, coTask._errCodeInternal, coTask._errDescription, coTask._buf);
|
||||||
DLLOG(" DownloaderCURL: finish Task: Id(%d)", coTask.serialId);
|
DLLOG(" DownloaderCURL: finish Task: Id(%d)", coTask.serialId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_impl->stoped())
|
|
||||||
{
|
|
||||||
_scheduler->pauseTarget(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace cocos2d::network
|
}} // namespace cocos2d::network
|
||||||
|
|
|
@ -79,7 +79,7 @@ var TextureLoadImgTest = TextureCacheTestBase.extend({
|
||||||
});
|
});
|
||||||
this.addChild(this._labelSecond, 1);
|
this.addChild(this._labelSecond, 1);
|
||||||
|
|
||||||
var url = "http://cn.cocos2d-x.org/image/logo.png";
|
var url = "http://www.cocos2d-x.org/images/logo.png";
|
||||||
cc.textureCache.addImageAsync(url, this.texFirstLoaded, this);
|
cc.textureCache.addImageAsync(url, this.texFirstLoaded, this);
|
||||||
cc.textureCache.addImageAsync(url, this.texSecondLoaded, this);
|
cc.textureCache.addImageAsync(url, this.texSecondLoaded, this);
|
||||||
},
|
},
|
||||||
|
@ -264,7 +264,7 @@ var TextureCacheTest = TextureCacheTestBase.extend({
|
||||||
var RemoteTextureTest = TextureCacheTestBase.extend({
|
var RemoteTextureTest = TextureCacheTestBase.extend({
|
||||||
_title:"Remote Texture Test",
|
_title:"Remote Texture Test",
|
||||||
_subtitle:"",
|
_subtitle:"",
|
||||||
_remoteTex: "http://cn.cocos2d-x.org/image/logo.png",
|
_remoteTex: "http://www.cocos2d-x.org/images/logo.png",
|
||||||
onEnter:function () {
|
onEnter:function () {
|
||||||
this._super();
|
this._super();
|
||||||
if('opengl' in cc.sys.capabilities && !cc.sys.isNative){
|
if('opengl' in cc.sys.capabilities && !cc.sys.isNative){
|
||||||
|
@ -277,7 +277,7 @@ var RemoteTextureTest = TextureCacheTestBase.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
startDownload: function() {
|
startDownload: function() {
|
||||||
var imageUrlArray = ["http://www.cocos2d-x.org/s/upload/v35.jpg", "http://www.cocos2d-x.org/s/upload/testin.jpg", "http://www.cocos2d-x.org/s/upload/geometry_dash.jpg", "http://cn.cocos2d-x.org/image/logo.png"];
|
var imageUrlArray = ["http://www.cocos2d-x.org/s/upload/v35.jpg", "http://www.cocos2d-x.org/s/upload/testin.jpg", "http://www.cocos2d-x.org/s/upload/geometry_dash.jpg", "http://www.cocos2d-x.org/images/logo.png"];
|
||||||
|
|
||||||
for (var i = 0; i < imageUrlArray.length; i++) {
|
for (var i = 0; i < imageUrlArray.length; i++) {
|
||||||
cc.textureCache.addImageAsync(imageUrlArray[i], this.texLoaded, this);
|
cc.textureCache.addImageAsync(imageUrlArray[i], this.texLoaded, this);
|
||||||
|
|
Loading…
Reference in New Issue