summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SmartDeviceLink/SDLTCPTransport.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLTCPTransport.m b/SmartDeviceLink/SDLTCPTransport.m
index e024d2558..2b57f1d56 100644
--- a/SmartDeviceLink/SDLTCPTransport.m
+++ b/SmartDeviceLink/SDLTCPTransport.m
@@ -97,7 +97,6 @@ NSTimeInterval ConnectionTimeoutSecs = 30.0;
}
- (void)disconnectWithCompletionHandler:(void (^)(void))disconnectCompletionHandler {
- self.disconnectCompletionHandler = disconnectCompletionHandler;
SDLLogD(@"Disconnecting");
[self.sendDataQueue removeAllObjects];
@@ -109,6 +108,8 @@ NSTimeInterval ConnectionTimeoutSecs = 30.0;
return disconnectCompletionHandler();
}
+ self.disconnectCompletionHandler = disconnectCompletionHandler;
+
// Attempt to cancel the `ioThread`. Once the thread realizes it has been cancelled, it will cleanup the input/output streams.
[self sdl_cancelIOThread];
}