diff options
author | Pulathaneli, Timur (tdp.) <tpulatha@ford.com> | 2017-04-19 11:06:20 -0700 |
---|---|---|
committer | Pulathaneli, Timur (tdp.) <tpulatha@ford.com> | 2017-04-19 11:06:20 -0700 |
commit | b4dca364081f0bc1ecd6fe7f296d8aa0f77211b6 (patch) | |
tree | 054636223286d037b16b677ff180efc7228db8a9 | |
parent | defbaecd441a10655498eebd5cfd1e57e5e3cf87 (diff) | |
download | sdl_ios-b4dca364081f0bc1ecd6fe7f296d8aa0f77211b6.tar.gz |
Fixed clearing of upload queue
Changed function name to “didEnter…” as the state machine does not call
“willEnter…” states. Cleared the ResponseHandlerMap on disconnect
-rw-r--r-- | SmartDeviceLink/SDLFileManager.m | 2 | ||||
-rw-r--r-- | SmartDeviceLink/SDLResponseDispatcher.m | 4 |
2 files changed, 5 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..1f2914e5e 100644 --- a/SmartDeviceLink/SDLResponseDispatcher.m +++ b/SmartDeviceLink/SDLResponseDispatcher.m @@ -108,6 +108,10 @@ NS_ASSUME_NONNULL_BEGIN } - (void)clear { + for (SDLRPCCorrelationId *key in self.rpcResponseHandlerMap) { + SDLResponseHandler f = self.rpcResponseHandlerMap[key]; + f(self.rpcRequestDictionary[key], nil, [NSError sdl_lifecycle_notConnectedError]); + } [self.rpcRequestDictionary removeAllObjects]; [self.rpcResponseHandlerMap removeAllObjects]; [self.commandHandlerMap removeAllObjects]; |