DataPointObserver::~DataPointObserver() { //TD13275 terminateAndWait(); if ( NULL != m_purgeExistingUpdatesTimer ) { m_purgeExistingUpdatesTimer->stopTiming(); delete m_purgeExistingUpdatesTimer; m_purgeExistingUpdatesTimer = NULL; } // reset the list of observed datapoints, without deleting // the actual datapoints since they are not created and owned // by this class std::map < unsigned long, DataPoint * >::iterator dpItr; for ( dpItr = m_listOfObservedDataPoints.begin(); dpItr != m_listOfObservedDataPoints.end(); dpItr++ ) { try { dpItr->second->deregisterForUpdateDetails ( this ); } catch ( ... ) { // do nothing as the data point might have been already removed } } m_listOfObservedDataPoints.clear(); // remove existing TA_Base_Bus::DataPointAgentCorbaDef::DataPointUpdate std::vector < TA_Base_Bus::DataPointCorbaTypes::SDynamicSyncUpdate* >::iterator itr; for ( itr = m_listOfUpdateDetails.begin(); itr != m_listOfUpdateDetails.end(); itr++ ) { delete (*itr); (*itr) = 0; } m_listOfUpdateDetails.clear(); // clear the reference to the data point agent, without actually deleting // the object m_specificDataPointAgent = NULL; }
// TODO LPP: Presumably the thread calling cancelExecutionAndWait() must not be the // same one calling execute() (eg. say m_command called back on this instance). void AsynchronousCommand::cancelExecutionAndWait() { terminateAndWait(); m_executing = false; }