Skip to content

Commit

Permalink
fix issue49 ; remove instead of destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkraimer committed Aug 1, 2019
1 parent e6bf92e commit 1c16398
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/pvaccess/PvaServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,7 @@ void PvaServer::removeRecord(const std::string& channelName)
if (it == recordMap.end()) {
throw ObjectNotFound("Master database does not have record for channel: " + channelName);
}

epics::pvDatabase::PVDatabasePtr master = epics::pvDatabase::PVDatabase::getMaster();
if(!master->removeRecord(it->second)) {
throw PvaException("Cannot remove record to master database for channel: " + channelName);
}
it->second->remove();
recordMap.erase(it);
}

Expand Down
5 changes: 0 additions & 5 deletions src/pvaccess/PyPvRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ bool PyPvRecord::init()
return true;
}

void PyPvRecord::destroy()
{
epics::pvDatabase::PVRecord::destroy();
}

void PyPvRecord::process()
{
if(PyUtility::isPyNone(onWriteCallback)) {
Expand Down
1 change: 0 additions & 1 deletion src/pvaccess/PyPvRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class PyPvRecord :
POINTER_DEFINITIONS(PyPvRecord);
virtual ~PyPvRecord();
virtual bool init();
virtual void destroy();
virtual void process();
void update (const PvObject& pvObject);
void executeCallback();
Expand Down
7 changes: 7 additions & 0 deletions test/issue49.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python
import pvaccess as pva

s = pva.PvaServer('foo', pva.PvObject({'value': pva.INT}))
c = pva.Channel('foo')
c.get()
s.removeRecord('foo')

0 comments on commit 1c16398

Please sign in to comment.