Skip to content

Commit 94cbff5

Browse files
committed
RTDEClient: pause and stop in destructor only if running
Otherwise we produce an error when destructing an initialized, but non-started client.
1 parent ce779b3 commit 94cbff5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rtde/rtde_client.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,13 @@ void RTDEClient::setupInputs()
445445
void RTDEClient::disconnect()
446446
{
447447
// If communication is started it should be paused before disconnecting
448-
if (client_state_ > ClientState::UNINITIALIZED)
448+
if (client_state_ == ClientState::RUNNING)
449449
{
450450
sendPause();
451451
pipeline_->stop();
452+
}
453+
if (client_state_ > ClientState::UNINITIALIZED)
454+
{
452455
stream_.disconnect();
453456
}
454457
client_state_ = ClientState::UNINITIALIZED;

0 commit comments

Comments
 (0)