Skip to content

Commit

Permalink
Fixing the destruction of objects under process control api.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha Nicolas committed Aug 18, 2017
1 parent b4f0d96 commit 390e323
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dyninstAPI/src/dynProcess.C
Expand Up @@ -285,6 +285,8 @@ PCProcess::~PCProcess() {
signalHandlerLocations_.clear();

trapMapping.clearTrapMappings();

if(pcProc_) pcProc_->setData(NULL);
}

void PCProcess::initSymtabReader()
Expand Down
3 changes: 2 additions & 1 deletion dyninstAPI/src/pcEventHandler.C
Expand Up @@ -70,10 +70,11 @@ bool PCEventHandler::handle_internal(EventPtr ev) {
return true;
}
PCProcess *evProc = static_cast<PCProcess *>(ev->getProcess()->getData());

if( evProc == NULL ) {
proccontrol_printf("%s[%d]: ERROR: handle to Dyninst process is invalid\n",
FILE__, __LINE__);
return false;
return true;
}


Expand Down
2 changes: 1 addition & 1 deletion dyninstAPI/src/pcEventMuxer.C
Expand Up @@ -457,7 +457,7 @@ Event::const_ptr PCEventMailbox::dequeue(bool block) {
Event::const_ptr ret = eventQueue.front();
eventQueue.pop();
PCProcess *evProc = static_cast<PCProcess *>(ret->getProcess()->getData());
procCount[evProc]--;
if(evProc) procCount[evProc]--;
assert(procCount[evProc] >= 0);
queueCond.unlock();

Expand Down

0 comments on commit 390e323

Please sign in to comment.