Skip to content

Commit

Permalink
dataflow: Added more disconnect code when connections fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Soetens committed Nov 26, 2009
1 parent 3ff9037 commit 31f3b3f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/internal/ConnFactory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() <<endlog();

Expand All @@ -278,6 +279,7 @@ namespace RTT
return true;
}
// setup failed.
channel_input->disconnect(true);
log(Error) << "The output port "<< output_port.getName()
<< " could not successfully use the connection to input port " << input_port.getName() <<endlog();
return false;
Expand Down
1 change: 1 addition & 0 deletions src/internal/ConnInputEndPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace RTT

~ConnInputEndpoint()
{
this->disconnect(false); // inform port (if any) we're gone.
delete cid;
}

Expand Down
1 change: 1 addition & 0 deletions src/internal/ConnOutputEndPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31f3b3f

Please sign in to comment.