diff --git a/cocos/network/CCDownloader-curl.cpp b/cocos/network/CCDownloader-curl.cpp index 60fc160daf..b052d1f9fd 100644 --- a/cocos/network/CCDownloader-curl.cpp +++ b/cocos/network/CCDownloader-curl.cpp @@ -779,6 +779,12 @@ namespace cocos2d { namespace network { // update finished tasks _impl->getFinishedTasks(tasks); + + if (_impl->stoped()) + { + _scheduler->pauseTarget(this); + } + for (auto& wrapper : tasks) { const DownloadTask& task = *wrapper.first; @@ -844,11 +850,6 @@ namespace cocos2d { namespace network { onTaskFinish(task, coTask._errCode, coTask._errCodeInternal, coTask._errDescription, coTask._buf); DLLOG(" DownloaderCURL: finish Task: Id(%d)", coTask.serialId); } - - if (_impl->stoped()) - { - _scheduler->pauseTarget(this); - } } }} // namespace cocos2d::network diff --git a/tests/js-tests/src/TextureCacheTest/TextureCacheTest.js b/tests/js-tests/src/TextureCacheTest/TextureCacheTest.js index 6be071b43c..5c6c0c2190 100644 --- a/tests/js-tests/src/TextureCacheTest/TextureCacheTest.js +++ b/tests/js-tests/src/TextureCacheTest/TextureCacheTest.js @@ -79,7 +79,7 @@ var TextureLoadImgTest = TextureCacheTestBase.extend({ }); 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.texSecondLoaded, this); }, @@ -264,7 +264,7 @@ var TextureCacheTest = TextureCacheTestBase.extend({ var RemoteTextureTest = TextureCacheTestBase.extend({ _title:"Remote Texture Test", _subtitle:"", - _remoteTex: "http://cn.cocos2d-x.org/image/logo.png", + _remoteTex: "http://www.cocos2d-x.org/images/logo.png", onEnter:function () { this._super(); if('opengl' in cc.sys.capabilities && !cc.sys.isNative){ @@ -277,7 +277,7 @@ var RemoteTextureTest = TextureCacheTestBase.extend({ }, 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++) { cc.textureCache.addImageAsync(imageUrlArray[i], this.texLoaded, this);