From 8e3eb8580f6fcca53dc61d39c8656eb937f613cc Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 18:00:52 +0800 Subject: [PATCH 1/2] fix crash in NewEventDispatcherTest.cpp on vs --- .../Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 5f41c4fdd9..b74ff5aaed 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -753,6 +753,10 @@ void DirectorEventTest::onEnter() { EventDispatcherTestDemo::onEnter(); + _count1 = 0; + _count2 = 0; + _count3 = 0; + _count4 = 0; Size s = Director::getInstance()->getWinSize(); _label1 = Label::createWithTTF("Update: 0", "fonts/arial.ttf", 20); From 4806ef5c6f167b4195e6f03d547de42e8f06593b Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 6 Jan 2014 18:26:14 +0800 Subject: [PATCH 2/2] change time of initialization --- .../NewEventDispatcherTest.cpp | 13 +++++++++---- .../NewEventDispatcherTest/NewEventDispatcherTest.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index b74ff5aaed..d23091db12 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -749,14 +749,19 @@ std::string RemoveListenerAfterAddingTest::subtitle() const // //DirectorEventTest // +DirectorEventTest::DirectorEventTest() +:_count1(0) +,_count2(0) +,_count3(0) +,_count4(0) +{ + +} + void DirectorEventTest::onEnter() { EventDispatcherTestDemo::onEnter(); - _count1 = 0; - _count2 = 0; - _count3 = 0; - _count4 = 0; Size s = Director::getInstance()->getWinSize(); _label1 = Label::createWithTTF("Update: 0", "fonts/arial.ttf", 20); diff --git a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h index 0512b3c31d..2de772a6af 100644 --- a/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h +++ b/samples/Cpp/TestCpp/Classes/NewEventDispatcherTest/NewEventDispatcherTest.h @@ -117,6 +117,7 @@ class DirectorEventTest : public EventDispatcherTestDemo { public: CREATE_FUNC(DirectorEventTest); + DirectorEventTest(); virtual void onEnter() override; virtual void onExit() override;