aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/Object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Common/Object.cpp')
-rw-r--r--src/libjin/Common/Object.cpp32
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