twitter-archive / CocoaSPDY

SPDY for iOS and OS X
Apache License 2.0
2.39k stars 233 forks source link

Fix crash in removing the runloop source. #156

Closed kgoodier closed 7 years ago

kgoodier commented 7 years ago

When using a proxy auto-configuration URL, we have to schedule the execution on a runloop. This patch attempts two fixes, though both are guesses as I cannot get a repro. The incidents of crashes in the CFRunLoopRemoveSource() call in _removeRunLoopSource has gone up dramatically for iOS 10.

  1. Simplify run loop modes. Just use common modes.
  2. Use CFRunLoopSourceInvalidate instead of CFRunLoopRemoveSource. It will remove the source from all modes and invalidate it.