Skip to content

Commit

Permalink
Prevent multiple calls during construction.
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielHare committed Jul 30, 2014
1 parent bf89fb2 commit c89c2ef
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/autowiring/AutoPacket.cpp
Expand Up @@ -175,10 +175,16 @@ void AutoPacket::Initialize(void) {
decoration.second.Reset();
}

// Call all subscribers with no required or optional arguments:
// Find all subscribers with no required or optional arguments:
std::list<SatCounter*> callCounters;
for (auto& satCounter : m_satCounters)
if (satCounter)
satCounter.CallAutoFilter(*this);
callCounters.push_back(&satCounter);

// Call all subscribers with no required or optional arguments:
// NOTE: This may result in decorations that cause other subscribers to be called.
for (auto* call : callCounters)
call->CallAutoFilter(*this);

// Initial satisfaction of the AutoPacket:
UpdateSatisfaction(typeid(AutoPacket));
Expand Down

0 comments on commit c89c2ef

Please sign in to comment.