Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not dispatch session invalidation on the main thread
The dispatching on main thread was introduced in 920e266 in order to fix #2053. It was not a proper fix but rather a lucky coincidence. This kind of KVO error must be fixed by ensuring that observer are properly registered and unregistered, not by dispatching some random method on the main thread. It is very important not to dispatch async session invalidation code because it is called in unit tests from the `tearDown` method. At that point, there’s no active runloop, so the session invalidation would not happen immediately but when running the next asynchronous unit test, i.e. when the `waitForExpectationsWithCommonTimeoutUsingHandler:` method is called. This commit, in conjunction with d869571 fixes #3710.
- Loading branch information