From 09850e792f3f78a980e7987af62a46c95ae4e69e Mon Sep 17 00:00:00 2001 From: Sebastian Melinat Date: Wed, 28 Jan 2015 11:47:03 +0100 Subject: [PATCH] Bugfix: ConnectionImpl::reportError calls ChannelImpl::reportError of every channel. The channel then removes itselfs from the connection. That caused the for loop to run out of bounds. Fixed by switching to while --- include/connectionimpl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/connectionimpl.h b/include/connectionimpl.h index 0c55f45..7283e03 100644 --- a/include/connectionimpl.h +++ b/include/connectionimpl.h @@ -308,11 +308,11 @@ public: Monitor monitor(this); // all deferred result objects in the channels should report this error too - for (auto &iter : _channels) + while (!_channels.empty()) { // report the errors - iter.second->reportError(message, false); - + _channels.begin()->second->reportError(message, false); + // leap out if no longer valid if (!monitor.valid()) return; }