From ea12b601d99c714e6ced7be2677341e9b26a504c Mon Sep 17 00:00:00 2001 From: Seivan Heidari Date: Sun, 6 Sep 2015 18:46:20 +0200 Subject: [PATCH] Don't call release() before retain() --- cocos/base/CCMap.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index 1c8c53ef0a..8144a9d90e 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -274,9 +274,9 @@ public: void insert(const K& key, V object) { CCASSERT(object != nullptr, "Object is nullptr!"); + object->retain(); erase(key); _data.insert(std::make_pair(key, object)); - object->retain(); } /** @@ -308,7 +308,6 @@ public: _data.erase(iter); return 1; } - return 0; }