diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-05-08 14:14:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-08 14:14:32 -0400 |
commit | b5ccdbd659723f7ec18ed52492f2e748841f3ff3 (patch) | |
tree | d4225d5a4379e9f5c9d49a836e45192002956a18 | |
parent | 3d541aa36e21f9d95a38aab411e03b667a62269e (diff) | |
parent | 3c6abc93c5c3a18679b2e1d4f33b6e7d5ceed5fc (diff) | |
download | sdl_ios-b5ccdbd659723f7ec18ed52492f2e748841f3ff3.tar.gz |
Merge pull request #608 from tpulatha/hotfix/issue_606
Fixed clearing of upload queue
-rw-r--r-- | SmartDeviceLink/SDLFileManager.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLResponseDispatcher.m | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLFileManager.m b/SmartDeviceLink/SDLFileManager.m index 0321691ac..7f20080f4 100644 --- a/SmartDeviceLink/SDLFileManager.m +++ b/SmartDeviceLink/SDLFileManager.m @@ -136,7 +136,7 @@ SDLFileManagerState *const SDLFileManagerStateStartupError = @"StartupError"; } } -- (void)willEnterStateShutdown { +- (void)didEnterStateShutdown { [self.transactionQueue cancelAllOperations]; [self.mutableRemoteFileNames removeAllObjects]; [self.class sdl_clearTemporaryFileDirectory]; diff --git a/SmartDeviceLink/SDLResponseDispatcher.m b/SmartDeviceLink/SDLResponseDispatcher.m index b4ac0b7cb..b9fcf4095 100644 --- a/SmartDeviceLink/SDLResponseDispatcher.m +++ b/SmartDeviceLink/SDLResponseDispatcher.m @@ -108,6 +108,11 @@ NS_ASSUME_NONNULL_BEGIN } - (void)clear { + // When we get disconnected we have to delete all existing responseHandlers as they are not valid anymore + for (SDLRPCCorrelationId *correlationID in self.rpcResponseHandlerMap) { + SDLResponseHandler responseHandler = self.rpcResponseHandlerMap[correlationID]; + responseHandler(self.rpcRequestDictionary[correlationID], nil, [NSError sdl_lifecycle_notConnectedError]); + } [self.rpcRequestDictionary removeAllObjects]; [self.rpcResponseHandlerMap removeAllObjects]; [self.commandHandlerMap removeAllObjects]; |