Do not defer stop more than once

May cause multiple delegation and queue deadlock when a
reconnection is scheduled to trigger.

Fixes #106
This commit is contained in:
Davide De Rosa 2019-07-09 14:09:02 +02:00
parent 5ea185fd75
commit aefeb252b3
1 changed files with 3 additions and 0 deletions

View File

@ -1198,6 +1198,9 @@ public class OpenVPNSession: Session {
}
private func deferStop(_ method: StopMethod, _ error: Error?) {
guard !isStopping else {
return
}
isStopping = true
let completion = { [weak self] in