mirror of https://github.com/axmolengine/axmol.git
Fix download task creation failure Program crash (#984)
* Support return type'ResourceData'
* Revert "Support return type'ResourceData'"
This reverts commit dd38d06350
.
* Support return type'ResourceData'
* Support binary files
* Support Lua to call cc.utils: capturenode
* Support Lua to call cc.utils: capturenode
* export: sp.SkeletonAnimation:findBone sp.SkeletonAnimation:getBoundingBox
* export 'setAttachment' function to lua
* Committing genbindings changes
* search path adding repeated judgment
* add macro definition AX_NO_DUP_SEARCH_PATH
* add macro definition AX_NO_DUP_SEARCH_PATH
* Update core/platform/CCFileUtils.cpp
* Fix downloader crash in the lua coroutine
* fix download task creation failure Program crash
Co-authored-by: tkzcfc <tkzcfc@users.noreply.github.com>
Co-authored-by: 一线灵|Deal <halx99@live.com>
Co-authored-by: HYGK-PC\Administrator <tkzc@foxmail.com>
This commit is contained in:
parent
5fe200ca0a
commit
fa0d9c8d55
|
@ -166,7 +166,10 @@ static int lua_downloader_createDownloadDataTask(lua_State* L)
|
||||||
identifier = lua_tostring(L, 3);
|
identifier = lua_tostring(L, 3);
|
||||||
auto tsk = d->createDownloadDataTask(url, identifier);
|
auto tsk = d->createDownloadDataTask(url, identifier);
|
||||||
|
|
||||||
pushTaskTable(L, *tsk);
|
if (tsk)
|
||||||
|
pushTaskTable(L, *tsk);
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +207,10 @@ static int lua_downloader_createDownloadFileTask(lua_State* L)
|
||||||
|
|
||||||
auto tsk = d->createDownloadFileTask(url, storagePath, identifier, md5checksum, background, cacertPath);
|
auto tsk = d->createDownloadFileTask(url, storagePath, identifier, md5checksum, background, cacertPath);
|
||||||
|
|
||||||
pushTaskTable(L, *tsk);
|
if (tsk)
|
||||||
|
pushTaskTable(L, *tsk);
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static int lua_downloader_setOnFileTaskSuccess(lua_State* L)
|
static int lua_downloader_setOnFileTaskSuccess(lua_State* L)
|
||||||
|
|
Loading…
Reference in New Issue