Files
cocos4/native/cocos/scripting/js-bindings/jswrapper/HandleObject.cpp
T
2017-07-31 16:00:39 +08:00

33 lines
420 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->release();
}
}
} // namespace se {