karelia/iMedia — pull request #51 by danielpunkass (2012-03-16 21:10:11+00:00)
Title: Fix for repeatedly oversubscribing to FSEvents on reload

Previously we were abusing FSEvents by re-registering for notification watched nodes on every reload. I noticed during testing with aggressive reloads that it was actually possible to fry the FSEvents system so that it stopped registering new events.

I added an assertion in addPath: in UKFSEventsWatcher, to ensure that in normal
usage no path is ever registered twice.

I added new helper methods in IMBLibraryController to centralize registration
and deregistration for FS events. Then I added a new call in -reload to
ensure that any existing event registrations for the nodes we are about to
reload get unregistered before reloading.