From e975c403ba24624be420086e2552392100b61071 Mon Sep 17 00:00:00 2001 From: Ming Date: Mon, 6 Sep 2010 02:57:21 +0000 Subject: [PATCH] issue #61: --- cocos2dx/include/CCSpriteFrame.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/cocos2dx/include/CCSpriteFrame.h b/cocos2dx/include/CCSpriteFrame.h index fc7f728790..39537334f0 100644 --- a/cocos2dx/include/CCSpriteFrame.h +++ b/cocos2dx/include/CCSpriteFrame.h @@ -112,7 +112,7 @@ protected: class CCX_DLL CCAnimation : public NSObject { protected: - char *m_pszName; + std::string m_nameStr; float m_fDelay; NSMutableArray *m_pobFrames; @@ -120,18 +120,8 @@ public: // attributes // name of the animation - inline char* getName(void) { return m_pszName; } - inline void setName(const char *pszName) - { - if (m_pszName) - { - delete m_pszName; - } - - m_pszName = new char[strlen(pszName) + 1]; - memcpy(m_pszName, pszName, strlen(pszName)); - m_pszName[strlen(pszName)] = '\0'; - } + inline const char* getName(void) { return m_nameStr.c_str(); } + inline void setName(const char *pszName){ m_nameStr = pszName; } // delay between frames in seconds inline float getDelay(void) { return m_fDelay; }