Browse files

Merge pull request #645 from minggo/iss926_rtti

fixed #926: retain/release in Paddle
  • Loading branch information...
2 parents 468a595 + b64660a commit 858092d2a8020c7e0d43067fd7e634bce356da8d @minggo minggo committed Dec 27, 2011
Showing with 14 additions and 1 deletion.
  1. +11 −1 tests/tests/TouchesTest/Paddle.cpp
  2. +3 −0 tests/tests/TouchesTest/Paddle.h
View
12 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;
-}
+}
+
+void Paddle::touchDelegateRetain()
+{
+ this->retain();
+}
+
+void Paddle::touchDelegateRelease()
+{
+ this->release();
+}
View
3 tests/tests/TouchesTest/Paddle.h
@@ -27,6 +27,9 @@ class Paddle : public CCSprite, public CCTargetedTouchDelegate
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);
};

0 comments on commit 858092d

Please sign in to comment.