fixed #16831: Error information is printed forever if there is an error is triggered in timer callback (#16833)

This commit is contained in:
James Chen
2024-03-28 11:42:17 +08:00
committed by GitHub
parent 620cd5c3d8
commit 7db7b125f8
5 changed files with 16 additions and 12 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ if (DEV) {
legacyCC._Test = {};
}
const engineVersion = '3.8.3';
const engineVersion = '3.8.4';
/**
* @en
+3 -3
View File
@@ -25,9 +25,9 @@ THE SOFTWARE.
#define COCOS_MAJOR_VERSION 3
#define COCOS_MINJOR_VERSION 8
#define COCOS_PATCH_VERSION 3
#define COCOS_VERSION_STRING "3.8.3"
#define COCOS_PATCH_VERSION 4
#define COCOS_VERSION_STRING "3.8.4"
#define COCOS_VERSION_DEFINED 1
#define COCOS_VERSION 30803
#define COCOS_VERSION 30804
// #define COCOS_PRE_RELEASE "release"
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "cocos-creator",
"version": "3.8.3",
"version": "3.8.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cocos-creator",
"version": "3.8.3",
"version": "3.8.4",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cocos-creator",
"version": "3.8.3",
"version": "3.8.4",
"description": "Cocos Creator is a cross-platform 2D & 3D game engine written in C++ and TypeScript, licensed under MIT.",
"homepage": "http://www.cocos.com",
"license": "MIT",
+9 -5
View File
@@ -82,16 +82,20 @@ function fireTimeout (nowMilliSeconds) {
if (info && info.cb) {
if ((nowMilliSeconds - info.start) >= info.delay) {
// console.log(`fireTimeout: id ${id}, start: ${info.start}, delay: ${info.delay}, now: ${nowMilliSeconds}`);
if (info.isRepeat) {
info.start = nowMilliSeconds;
} else {
// The delete operation should be performed before the timeout callback.
// This is because if an error occurs during the timeout callback,
// it could be triggered indefinitely, leading to a game freeze.
delete _timeoutInfos[id];
}
if (typeof info.cb === 'string') {
Function(info.cb)();
} else if (typeof info.cb === 'function') {
info.cb.apply(info.target, info.args);
}
if (info.isRepeat) {
info.start = nowMilliSeconds;
} else {
delete _timeoutInfos[id];
}
}
}
}