Closed lihaoyi closed 5 years ago
Good catch. Based on the documentation, it looks like we need to call CFRunLoopStop
, then FSEventStreamInvalidate
, then FSEventStreamRelease
. FSEventStreamInvalidate
will automatically unschedule from all run loops. Seems like if we don't we might leak memory or file descriptors.
Fixed in 0.9.2
It seems you're calling
CFRunLoopStop
andCFRunLoopStop
, but according to https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/FSEvents_ProgGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40005289?language=objc you also need to callFSEventStreamUnscheduleFromRunLoop
,FSEventStreamInvalidate
, andFSEventStreamRelease
. Not sure what the consequence is of not calling those, but I suppose it's best practice to do so. Probably leaking some small amount of memory if we don't.