Avoid deadlock on double close
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-01-12 12:05:07 -08:00
parent 35247bd044
commit 023d1a6e5d
1 changed files with 9 additions and 7 deletions

View File

@ -297,6 +297,7 @@ func (tp *torProvider) Close() {
delete(tp.childListeners, addr)
}
if !tp.isClosed {
// Break out of any background checks and close
// the underlying tor connection
tp.isClosed = true
@ -305,6 +306,7 @@ func (tp *torProvider) Close() {
tp.t.Close()
tp.t = nil
}
}
}
func (tp *torProvider) SetStatusCallback(callback func(int, string)) {