Skip to content

Commit

Permalink
deref iterators before calling methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul authored and Paul committed Jul 2, 2018
1 parent e2e7393 commit e8a4c50
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/zmq/zmqnotificationinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool CZMQNotificationInterface::Initialize()
auto it=notifiers.begin();
for (; it!=notifiers.end(); ++it)
{
if (it->Initialize(pcontext))
if ((*it)->Initialize(pcontext))
{
LogPrint("zmq", " Notifier %s ready (address = %s)\n", it->GetType(), it->GetAddress());
}
Expand Down Expand Up @@ -118,7 +118,7 @@ void CZMQNotificationInterface::Shutdown()
for (auto it=notifiers.begin(); it!=notifiers.end(); ++it)
{
LogPrint("zmq", " Shutdown notifier %s at %s\n", it->GetType(), it->GetAddress());
it->Shutdown();
(*it)->Shutdown();
}
zmq_ctx_destroy(pcontext);

Expand All @@ -133,13 +133,13 @@ void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, co

for (auto it = notifiers.begin(); it!=notifiers.end(); )
{
if (it->NotifyBlock(pindexNew))
if ((*it)->NotifyBlock(pindexNew))
{
it++;
}
else
{
it->Shutdown();
(*it)->Shutdown();
it = notifiers.erase(i);
}
}
Expand All @@ -149,13 +149,13 @@ void CZMQNotificationInterface::SyncTransaction(const CTransaction& tx, const CB
{
for (auto it = notifiers.begin(); it!=notifiers.end(); )
{
if (it->NotifyTransaction(tx))
if ((*it)->NotifyTransaction(tx))
{
it++;
}
else
{
it->Shutdown();
(*it)->Shutdown();
it = notifiers.erase(i);
}
}
Expand All @@ -165,13 +165,13 @@ void CZMQNotificationInterface::NotifyTransactionLock(const CTransaction &tx)
{
for (auto it = notifiers.begin(); it!=notifiers.end(); )
{
if (it->NotifyTransactionLock(tx))
if ((*it)->NotifyTransactionLock(tx))
{
it++;
}
else
{
it->Shutdown();
(*it)->Shutdown();
it = notifiers.erase(i);
}
}
Expand All @@ -181,13 +181,13 @@ void CZMQNotificationInterface::NotifyGovernanceVote(const CGovernanceVote &vote
{
for (auto it = notifiers.begin(); it != notifiers.end(); )
{
if (it->NotifyGovernanceVote(vote))
if ((*it)->NotifyGovernanceVote(vote))
{
it++;
}
else
{
it->Shutdown();
(*it)->Shutdown();
it = notifiers.erase(i);
}
}
Expand All @@ -197,13 +197,13 @@ void CZMQNotificationInterface::NotifyGovernanceObject(const CGovernanceObject &
{
for (auto it = notifiers.begin(); it != notifiers.end(); )
{
if (it->NotifyGovernanceObject(object))
if ((*it)->NotifyGovernanceObject(object))
{
it++;
}
else
{
it->Shutdown();
(*it)->Shutdown();
it = notifiers.erase(i);
}
}
Expand Down

0 comments on commit e8a4c50

Please sign in to comment.