Listener objects will now be removed when their scope ends.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1700 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-09-27 09:59:20 +00:00
parent 2c1c3e8f02
commit b07fa4dcb7
2 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,11 @@
namespace fail {
BaseListener::~BaseListener()
{
simulator.removeListener(this);
}
bool TroubleListener::isMatching(const TroubleEvent* pEv) const
{
for (unsigned i = 0; i < m_WatchNumbers.size(); i++) {

View File

@ -30,7 +30,7 @@ public:
BaseListener()
: m_OccCounter(1), m_OccCounterInit(1), m_Parent(NULL), m_Loc(INVALID_INDEX), m_Home(NULL)
{ }
virtual ~BaseListener() { } // FIXME remove from queues
virtual ~BaseListener();
/**
* This method is called when an experiment flow adds a new listener by
* calling \c simulator.addListener() or \c simulator.addListenerAndResume().