Files
cocos4/native/cocos/scripting/js-bindings/jswrapper/Ref.cpp
T
2017-06-15 17:24:30 +08:00

44 lines
490 B
C++

//
// Ref.cpp
// cocos2d_js_bindings
//
// Created by James Chen on 4/27/17.
//
//
#include "Ref.hpp"
namespace se {
void Ref::addRef()
{
++_refCount;
}
void Ref::release()
{
--_refCount;
if (_refCount == 0)
{
delete this;
}
}
unsigned int Ref::getReferenceCount()
{
return _refCount;
}
Ref::Ref()
: _refCount(1)
{
}
Ref::~Ref()
{
}
} // namespace se {