diff --git a/pmc/object.cc b/pmc/object.cc --- a/pmc/object.cc +++ b/pmc/object.cc @@ -7,11 +7,14 @@ #include +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; +}