summaryrefslogtreecommitdiffstats
path: root/src/engine/InputPort.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/InputPort.cpp')
-rw-r--r--src/engine/InputPort.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/engine/InputPort.cpp b/src/engine/InputPort.cpp
index 80ae836d..cc72a7c5 100644
--- a/src/engine/InputPort.cpp
+++ b/src/engine/InputPort.cpp
@@ -163,10 +163,16 @@ InputPort::remove_connection(const OutputPort* src_port)
ThreadManager::assert_thread(THREAD_PROCESS);
Connections::Node* connection = NULL;
- for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i)
+ for (Connections::iterator i = _connections.begin(); i != _connections.end();) {
+ Connections::iterator next = i;
+ ++next;
+
if ((*i)->src_port() == src_port)
connection = _connections.erase(i);
+ i = next;
+ }
+
if ( ! connection) {
error << "[InputPort::remove_connection] Connection not found!" << endl;
return NULL;