Fix crash when slots disconnect from a signal in response to that signal

Originally committed to SVN as r5806.
This commit is contained in:
Thomas Goyne 2011-11-03 00:29:13 +00:00
parent ccebd521c6
commit 6a31f840a6
1 changed files with 5 additions and 2 deletions

View File

@ -183,8 +183,11 @@ namespace detail {
} }
#define SIGNALS_H_FOR_EACH_SIGNAL(...) \ #define SIGNALS_H_FOR_EACH_SIGNAL(...) \
for (typename super::SlotMap::iterator cur = slots.begin(); cur != slots.end(); ++cur) { \ for (typename super::SlotMap::iterator cur = slots.begin(); cur != slots.end();) { \
if (!Blocked(cur->first)) cur->second(__VA_ARGS__); \ if (Blocked(cur->first)) \
++cur; \
else \
(cur++)->second(__VA_ARGS__); \
} }
/// @class Signal /// @class Signal