From 31f3b3f014c554bb35aa05db2b323e356ea90fbc Mon Sep 17 00:00:00 2001 From: Peter Soetens Date: Tue, 24 Nov 2009 10:45:45 +0100 Subject: [PATCH] dataflow: Added more disconnect code when connections fail. --- src/internal/ConnFactory.hpp | 2 ++ src/internal/ConnInputEndPoint.hpp | 1 + src/internal/ConnOutputEndPoint.hpp | 1 + 3 files changed, 4 insertions(+) diff --git a/src/internal/ConnFactory.hpp b/src/internal/ConnFactory.hpp index 515a86178..90593b167 100644 --- a/src/internal/ConnFactory.hpp +++ b/src/internal/ConnFactory.hpp @@ -268,6 +268,7 @@ namespace RTT if ( output_port.addConnection( input_port.getPortID(), channel_input, policy ) ) { // notify input that the connection is now complete. if ( input_port.channelReady( channel_input->getOutputEndPoint() ) == false ) { + output_port.disconnect( input_port ); log(Error) << "The input port "<< input_port.getName() << " could not successfully read from the connection from output port " << output_port.getName() <disconnect(true); log(Error) << "The output port "<< output_port.getName() << " could not successfully use the connection to input port " << input_port.getName() <disconnect(false); // inform port (if any) we're gone. delete cid; } diff --git a/src/internal/ConnOutputEndPoint.hpp b/src/internal/ConnOutputEndPoint.hpp index 387fb8d2a..5b9d14119 100644 --- a/src/internal/ConnOutputEndPoint.hpp +++ b/src/internal/ConnOutputEndPoint.hpp @@ -74,6 +74,7 @@ namespace RTT ~ConnOutputEndpoint() { + this->disconnect(true); // inform port (if any) we're gone. delete cid; } /** Writes a new sample on this connection