pmc/object.cc
changeset 54 c064ce9f40f5
parent 42 83b8151b966d
child 65 76514757b0d6
--- a/pmc/object.cc
+++ b/pmc/object.cc
@@ -7,11 +7,14 @@
 
 #include <iostream>
 
+int refCounter = 0;
+
 Object::~Object ()
 {
 #ifdef DEBUG
     std::cerr << "Freeing Object " << name << std::endl;
 #endif
+    refCounter--;
 }
 
 std::string Object::getName ()
@@ -23,3 +26,8 @@
 {
     return *this;
 }
+
+int Object::getInstances ()
+{
+    return refCounter;
+}