numist / Switch

A window-based context switcher for the Mac
157 stars 17 forks source link

Window content workers being leaked somewhere #121

Closed numist closed 9 years ago

numist commented 9 years ago

Not sure how, but there's definitely instances of SWWindowWorker polling for window contents long after the interface has been dismissed.

numist commented 9 years ago

Looks like the service state is good, SWWindowListService and SWWindowContentsService are both stopped and the SWHUDCollectionView of the SWCoreWindowController is empty, so it seems likely that a thumbnail view is being leaked.

numist commented 9 years ago

Looks like the problem was a race where a window content worker was requested from SWWindowContentsService after the service had stopped, but it dutifully added a worker object anyway.

a4b268ce3d708199e893dd775f653043fcc91290 (which is arriving with #105) changes the service so its internal collection is nil when the service is stopped. Worker objects can still be created, but they won't be stored.