summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPulathaneli, Timur (tdp.) <tpulatha@ford.com>2017-04-19 11:06:20 -0700
committerPulathaneli, Timur (tdp.) <tpulatha@ford.com>2017-04-19 11:06:20 -0700
commitb4dca364081f0bc1ecd6fe7f296d8aa0f77211b6 (patch)
tree054636223286d037b16b677ff180efc7228db8a9
parentdefbaecd441a10655498eebd5cfd1e57e5e3cf87 (diff)
downloadsdl_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.m2
-rw-r--r--SmartDeviceLink/SDLResponseDispatcher.m4
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];