From 36e44dbaf962a2fcd13d4a2fa3bb3225b2e0c2bf Mon Sep 17 00:00:00 2001 From: Eric Zhong Date: Tue, 18 Nov 2014 22:05:56 +0800 Subject: [PATCH] set default priority to avoid warning when call 'scheduleUpdate' and 'unscheuleUpdate' several times in one frame, it will get warning "warning: you CANNOT change update priority in scheduled function" --- cocos/base/CCScheduler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/base/CCScheduler.cpp b/cocos/base/CCScheduler.cpp index 18575ac12b..1fb32a1379 100644 --- a/cocos/base/CCScheduler.cpp +++ b/cocos/base/CCScheduler.cpp @@ -447,6 +447,7 @@ void Scheduler::appendIn(_listEntry **list, const ccSchedulerFunc& callback, voi listElement->callback = callback; listElement->target = target; listElement->paused = paused; + listElement->priority = 0; listElement->markedForDeletion = false; DL_APPEND(*list, listElement);