Skip to content

Commit

Permalink
fix(plc4go/spi): re-order disconnection on Defaukt codec
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Jun 16, 2023
1 parent 3c7acbd commit 3456bca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plc4go/spi/default/DefaultCodec.go
Expand Up @@ -160,13 +160,13 @@ func (m *defaultCodec) Disconnect() error {
}
m.log.Trace().Msg("Disconnecting")
m.running.Store(false)
m.log.Trace().Msg("Waiting for worker to shutdown")
m.activeWorker.Wait()
if m.transportInstance != nil {
if err := m.transportInstance.Close(); err != nil {
return errors.Wrap(err, "error closing transport instance")
}
}
m.log.Trace().Msg("Waiting for worker to shutdown")
m.activeWorker.Wait()
m.log.Trace().Msg("disconnected")
return nil
}
Expand Down

0 comments on commit 3456bca

Please sign in to comment.