Commit d2330e49 authored by liujiangnan's avatar liujiangnan

fix: 主动释放

parent f7f058c2
......@@ -14,6 +14,13 @@ cc.Class({
this.initSize();
},
// 生命周期
onDestroy() {
if(this.timeA){
clearTimeout(this.timeA);
}
},
_imageResList: null,
_audioResList: null,
_animaResList: null,
......@@ -329,6 +336,7 @@ cc.Class({
this.playEffect('jumpAll');
},
timeA: null,
nextQuestion() {
const box = cc.find('Canvas/bg/box');
box.children.forEach(child => {
......@@ -340,7 +348,7 @@ cc.Class({
this.status.currentQuestionIdx++;
if (this.status.currentQuestionIdx < this.data.question_arr.length) {
setTimeout(() => {
this.timeA = setTimeout(() => {
this.jumpToQuestion(this.status.currentQuestionIdx);
}, 0.1 * 1000);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment