2018-04-21 21:24:46 +08:00
|
|
|
#include "..\e2dbase.h"
|
|
|
|
|
#include "..\e2dmanager.h"
|
2017-10-12 23:34:13 +08:00
|
|
|
|
2018-05-15 23:59:58 +08:00
|
|
|
|
2018-03-03 11:46:57 +08:00
|
|
|
e2d::Object::Object()
|
2018-05-09 00:34:15 +08:00
|
|
|
: _refCount(0)
|
2017-10-12 23:34:13 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-03 11:46:57 +08:00
|
|
|
e2d::Object::~Object()
|
2017-10-12 23:34:13 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 23:59:58 +08:00
|
|
|
void e2d::Object::autorelease()
|
|
|
|
|
{
|
|
|
|
|
ObjectManager::__add(this);
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-03 11:46:57 +08:00
|
|
|
void e2d::Object::retain()
|
2017-10-12 23:34:13 +08:00
|
|
|
{
|
2018-05-14 22:51:40 +08:00
|
|
|
++_refCount;
|
2017-10-12 23:34:13 +08:00
|
|
|
}
|
|
|
|
|
|
2018-03-03 11:46:57 +08:00
|
|
|
void e2d::Object::release()
|
2017-10-12 23:34:13 +08:00
|
|
|
{
|
2018-05-09 00:34:15 +08:00
|
|
|
_refCount--;
|
2018-04-21 00:46:26 +08:00
|
|
|
ObjectManager::flush();
|
2017-10-12 23:34:13 +08:00
|
|
|
}
|
2018-03-03 17:02:08 +08:00
|
|
|
|
2018-04-21 18:22:01 +08:00
|
|
|
int e2d::Object::getRefCount() const
|
2018-03-03 17:02:08 +08:00
|
|
|
{
|
2018-05-09 00:34:15 +08:00
|
|
|
return _refCount;
|
2018-05-15 23:59:58 +08:00
|
|
|
}
|