From 08e0be754b87cf051df7483e6f7c0b18e8439808 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 28 Dec 2011 15:13:02 +0800 Subject: [PATCH] fixed #926: retain/release in Paddle --- tests/tests/TouchesTest/Paddle.cpp | 12 +++++++++++- tests/tests/TouchesTest/Paddle.h | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/tests/TouchesTest/Paddle.cpp b/tests/tests/TouchesTest/Paddle.cpp index a6e8d312dd..b5a7532cc2 100644 --- a/tests/tests/TouchesTest/Paddle.cpp +++ b/tests/tests/TouchesTest/Paddle.cpp @@ -81,4 +81,14 @@ void Paddle::ccTouchEnded(CCTouch* touch, CCEvent* event) CCAssert(m_state == kPaddleStateGrabbed, L"Paddle - Unexpected state!"); m_state = kPaddleStateUngrabbed; -} \ No newline at end of file +} + +void Paddle::touchDelegateRetain() +{ + this->retain(); +} + +void Paddle::touchDelegateRelease() +{ + this->release(); +} \ No newline at end of file diff --git a/tests/tests/TouchesTest/Paddle.h b/tests/tests/TouchesTest/Paddle.h index ac9b5fb3a4..0a6e6b051b 100644 --- a/tests/tests/TouchesTest/Paddle.h +++ b/tests/tests/TouchesTest/Paddle.h @@ -27,6 +27,9 @@ public: virtual bool ccTouchBegan(CCTouch* touch, CCEvent* event); virtual void ccTouchMoved(CCTouch* touch, CCEvent* event); virtual void ccTouchEnded(CCTouch* touch, CCEvent* event); + + virtual void touchDelegateRetain(); + virtual void touchDelegateRelease(); static Paddle* paddleWithTexture(CCTexture2D* aTexture); };