From 25f6920f1f0cfd8b886c6c8009c8ff948673a76c Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 15 Jun 2001 22:39:54 +0000 Subject: [PATCH] fixed bug where resource was deallocated but it was still in the hash table --- src/ca/autoPtrRecycle.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ca/autoPtrRecycle.h b/src/ca/autoPtrRecycle.h index 0f4bf100a..73160af2c 100644 --- a/src/ca/autoPtrRecycle.h +++ b/src/ca/autoPtrRecycle.h @@ -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::autoPtrRecycle ( cacRecycle &rIn, T *pIn ) : - p ( pIn ), r ( rIn ) {} +inline autoPtrRecycle::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::~autoPtrRecycle () { if ( this->p ) { baseNMIU *pb = this->p; + this->ioTable.remove ( *pb ); + this->eventq.remove ( *pb ); pb->destroy ( this->r ); } }