Files
cocos4/native/cocos/scripting/js-bindings/jswrapper/HandleObject.cpp
T
James Chen 53250dad49 se::Ref -> se::RefCounter, addRef -> incRef, release -> decRef
This is for distinguishing from cocos2d::Ref.
2017-08-31 14:24:34 +08:00

33 lines
419 B
C++

//
// HandleObject.cpp
// cocos2d_js_bindings
//
// Created by James Chen on 7/31/17.
//
//
#include "HandleObject.hpp"
#include "Object.hpp"
namespace se {
HandleObject::HandleObject(Object* obj)
: _obj(obj)
{
if (_obj != nullptr)
{
_obj->root();
}
}
HandleObject::~HandleObject()
{
if (_obj != nullptr)
{
_obj->unroot();
_obj->decRef();
}
}
} // namespace se {