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