Program: bbtk
Module: $RCSfile: bbtkObject.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:13 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2009/04/30 14:31:31 $
+ Version: $Revision: 1.11 $
=========================================================================*/
/* ---------------------------------------------------------------------
{
std::cout<<"* Note : "<<u
<<" object in list has 0 ref count, "
- <<"i.e. destroyed without removing itself from the living objects list ! (this is just an implementation error not a memory leak)"<<std::endl;
+ <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl;
}
else if (u>1)
{
std::cout<<"* Note : "<<u
<<" objects in list have 0 ref count, "
- <<"i.e. destroyed without removing themselves from the living objects list ! (this is just an implementation error not a memory leak)"<<std::endl;
+ <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl;
}
std::cout
<< "============ EO Living bbtk::Object pointers ========="<<std::endl;
bbtkDebugMessage("object",1,"##> Object::Deleter : deleting \""
<<name<<"\" ["<<adr<<"]"<<std::endl);
#endif
- Object::RemoveFromObjectList(mPointer);
- this->Delete(p);
- bbtkDebugMessage("object",2,"<## Object::Deleter : \""<<name<<"\" ["
- <<adr<<"] deleted"<<std::endl);
+ int remaining = this->Delete(p);
+ if (remaining == 0)
+ {
+ Object::RemoveFromObjectList(mPointer);
+ bbtkDebugMessage("object",2,"<## Object::Deleter : \""<<name<<"\" ["
+ <<adr<<"] deleted"<<std::endl);
+ }
+ else
+ {
+ bbtkWarning("##### Object::Deleter \""<<name<<"\" failed !!! "
+ << remaining << " reference(s) still around..."
+ <<std::endl);
+ }
}
//=======================================================================