pvDatabase::removeRecord and pvRecord::remove no longer call eachother directly

This commit is contained in:
mrkraimer
2020-02-12 09:13:19 -05:00
parent 083dffac3c
commit 75c16bd423
4 changed files with 77 additions and 43 deletions

View File

@@ -65,17 +65,9 @@ PVRecord::~PVRecord()
}
}
void PVRecord::remove(bool callpvDatabaseRemoveRecord)
void PVRecord::unlistenClients()
{
if(traceLevel>0) {
cout << "PVRecord::remove() " << recordName << endl;
}
epicsGuard<epics::pvData::Mutex> guard(mutex);
if(callpvDatabaseRemoveRecord) {
PVDatabasePtr pvDatabase(PVDatabase::getMaster());
if(pvDatabase) pvDatabase->removeRecord(shared_from_this(),false);
}
pvTimeStamp.detach();
epicsGuard<epics::pvData::Mutex> guard(mutex);
for(std::list<PVListenerWPtr>::iterator iter = pvListenerList.begin();
iter!=pvListenerList.end();
iter++ )
@@ -102,6 +94,19 @@ void PVRecord::remove(bool callpvDatabaseRemoveRecord)
clientList.clear();
}
void PVRecord::remove()
{
if(traceLevel>0) {
cout << "PVRecord::remove() " << recordName << endl;
}
unlistenClients();
epicsGuard<epics::pvData::Mutex> guard(mutex);
PVDatabasePtr pvDatabase(PVDatabase::getMaster());
if(pvDatabase) pvDatabase->removeFromMap(shared_from_this());
pvTimeStamp.detach();
}
void PVRecord::initPVRecord()
{
PVRecordStructurePtr parent;