327f05a567
Hiding the dock icon after the viewer window closes triggers an asynchronous screen/dock reconfiguration via SkyLight. Without draining the main run loop, the resulting NSScreen invalidation notification is dispatched to a GCD worker thread, which hits NSScreen's main-thread assertion and crashes the process. Drain the main NSRunLoop briefly after setActivationPolicy: so the reconfiguration is processed on the main thread.