diff --git a/Parse/Internal/PFEventuallyQueue.h b/Parse/Internal/PFEventuallyQueue.h index 4e36b4d6c..7e6a2eb64 100644 --- a/Parse/Internal/PFEventuallyQueue.h +++ b/Parse/Internal/PFEventuallyQueue.h @@ -67,7 +67,7 @@ extern NSTimeInterval const PFEventuallyQueueDefaultTimeoutRetryInterval; - (void)start NS_REQUIRES_SUPER; - (void)resume NS_REQUIRES_SUPER; - (void)pause NS_REQUIRES_SUPER; - +- (void)stop NS_REQUIRES_SUPER; - (void)removeAllCommands NS_REQUIRES_SUPER; @end diff --git a/Parse/Internal/PFEventuallyQueue.m b/Parse/Internal/PFEventuallyQueue.m index 663024e7b..68d31aad5 100644 --- a/Parse/Internal/PFEventuallyQueue.m +++ b/Parse/Internal/PFEventuallyQueue.m @@ -197,6 +197,10 @@ - (void)pause { dispatch_suspend(_processingQueueSource); } +- (void)stop { + dispatch_source_cancel(_processingQueueSource); +} + - (void)removeAllCommands { dispatch_sync(_synchronizationQueue, ^{ [_taskCompletionSources removeAllObjects]; diff --git a/Parse/Internal/ParseManager.m b/Parse/Internal/ParseManager.m index 3c8be934b..b6c9d4af3 100644 --- a/Parse/Internal/ParseManager.m +++ b/Parse/Internal/ParseManager.m @@ -174,12 +174,15 @@ - (PFEventuallyQueue *)eventuallyQueue { [PFPinningEventuallyQueue newDefaultPinningEventuallyQueueWithDataSource:self] : commandCache); - // We still need to clear out the old command cache even if we're using Pinning in case // anything is left over when the user upgraded. Checking number of pending and then // clearing should be enough. - if (self.offlineStoreLoaded && commandCache.commandCount > 0) { - [commandCache removeAllCommands]; + if (self.offlineStoreLoaded) { + if (commandCache.commandCount > 0) { + [commandCache removeAllCommands]; + } + // we won't need it after stop everything... + [commandCache stop]; } } #endif diff --git a/Rakefile b/Rakefile index 3571fe6e3..e23a6431e 100644 --- a/Rakefile +++ b/Rakefile @@ -299,8 +299,7 @@ namespace :test do t.scheme = 'Parse-iOS' t.sdk = 'iphonesimulator' - t.destinations = ["\"platform=iOS Simulator,OS=9.1,name=iPhone 4s\"", - "\"platform=iOS Simulator,OS=9.1,name=iPhone 6s\"",] + t.destinations = ["\"platform=iOS Simulator,OS=9.1,name=iPhone 6s\"",] t.configuration = 'Debug' t.additional_options = { "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS" => "YES", "GCC_GENERATE_TEST_COVERAGE_FILES" => "YES" }