mirror of https://github.com/axmolengine/axmol.git
Merge pull request #1414 from walzer/gles20
fixed #1492, assert if user add an CCObject* into CCAutoreleasePool twice.
This commit is contained in:
commit
586f5100de
|
@ -41,6 +41,8 @@ CCAutoreleasePool::~CCAutoreleasePool(void)
|
|||
|
||||
void CCAutoreleasePool::addObject(CCObject* pObject)
|
||||
{
|
||||
CCAssert(false == pObject->m_bManaged, "this object is already in autorelese pool");
|
||||
|
||||
m_pManagedObjectArray->addObject(pObject);
|
||||
|
||||
CCAssert(pObject->m_uReference > 1, "reference count should be greater than 1");
|
||||
|
|
|
@ -38,15 +38,13 @@ CCObject* CCCopying::copyWithZone(CCZone *pZone)
|
|||
}
|
||||
|
||||
CCObject::CCObject(void)
|
||||
:m_bManaged(false)
|
||||
,m_uReference(1) // when the object is created, the reference count of it is 1
|
||||
,m_nLuaID(0)
|
||||
{
|
||||
static unsigned int uObjectCount = 0;
|
||||
|
||||
m_uID = ++uObjectCount;
|
||||
m_nLuaID = 0;
|
||||
|
||||
// when the object is created, the reference count of it is 1
|
||||
m_uReference = 1;
|
||||
m_bManaged = false;
|
||||
}
|
||||
|
||||
CCObject::~CCObject(void)
|
||||
|
|
Loading…
Reference in New Issue