From 3b874f759c0cd1b7f1e9bfed644532c5d7f1db77 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 28 Oct 2013 21:57:52 -0400 Subject: [PATCH] Fix of last commit, bug689. --- include/verilated_vpi.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/verilated_vpi.h b/include/verilated_vpi.h index 40ec1e7bc..a045d82e1 100644 --- a/include/verilated_vpi.h +++ b/include/verilated_vpi.h @@ -342,9 +342,8 @@ public: VpioCbList& cbObjList = s_s.m_cbObjLists[cbp->reason()]; // We do not remove it now as we may be iterating the list, // instead set to NULL and will cleanup later - for (VpioCbList::iterator it=cbObjList.begin(); it!=cbObjList.end(); ) { - if (*it == cbp) it = cbObjList.erase(it); - else ++it; + for (VpioCbList::iterator it=cbObjList.begin(); it!=cbObjList.end(); ++it) { + if (*it == cbp) *it = NULL; } } static void cbTimedRemove(VerilatedVpioCb* cbp) {