diff options
author | chai <chaifix@163.com> | 2018-08-06 16:22:00 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-06 16:22:00 +0800 |
commit | 89e7a9ecfad9a54633eb3ebbab1d1f13ad78826f (patch) | |
tree | 1ba8a806af1b8e7750d6b637c296f08e13cf268e /src/libjin/Common/Object.cpp | |
parent | ea9769944a2db3abe15f537dab67e16fdfc20bef (diff) |
*update
Diffstat (limited to 'src/libjin/Common/Object.cpp')
-rw-r--r-- | src/libjin/Common/Object.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libjin/Common/Object.cpp b/src/libjin/Common/Object.cpp new file mode 100644 index 0000000..6c3b667 --- /dev/null +++ b/src/libjin/Common/Object.cpp @@ -0,0 +1,32 @@ +// LOVE +#include "Object.h" + +namespace jin +{ + + Object::Object() + : count(1) + { + } + + Object::~Object() + { + } + + int Object::getReferenceCount() const + { + return count; + } + + void Object::retain() + { + ++count; + } + + void Object::release() + { + if (--count <= 0) + delete this; + } + +} // love |