fixed bug where resource was deallocated but it was still in the hash table

This commit is contained in:
Jeff Hill
2001-06-15 22:39:54 +00:00
parent ca76832387
commit 25f6920f1f
+9 -3
View File
@@ -21,7 +21,8 @@
template < class T >
class autoPtrRecycle {
public:
autoPtrRecycle ( cacRecycle &, T * );
autoPtrRecycle ( chronIntIdResTable < baseNMIU > &,
tsDLList < class baseNMIU > &, cacRecycle &, T * );
~autoPtrRecycle ();
T & operator * () const;
T * operator -> () const;
@@ -30,17 +31,22 @@ public:
private:
T *p;
cacRecycle &r;
tsDLList < class baseNMIU > &eventq;
chronIntIdResTable < baseNMIU > &ioTable;
};
template < class T >
inline autoPtrRecycle<T>::autoPtrRecycle ( cacRecycle &rIn, T *pIn ) :
p ( pIn ), r ( rIn ) {}
inline autoPtrRecycle<T>::autoPtrRecycle ( chronIntIdResTable < baseNMIU > &tbl,
tsDLList < class baseNMIU > &list, cacRecycle &rIn, T *pIn ) :
p ( pIn ), r ( rIn ), eventq ( list ), ioTable ( tbl ) {}
template < class T >
inline autoPtrRecycle<T>::~autoPtrRecycle ()
{
if ( this->p ) {
baseNMIU *pb = this->p;
this->ioTable.remove ( *pb );
this->eventq.remove ( *pb );
pb->destroy ( this->r );
}
}