SwiftFolderMonitor
SwiftFolderMonitor copied to clipboard
Crashes on deinit for more
Initialised it with a directory. When the object gets dealloced I get an EXC_BADINSTRUCTION
Did you ever find a solution to this? I'm getting it too
I found a solution: A DispatchSource must not be be suspended when it is cancelled. By adding resume()
to the deinit
we can ensure it is definitely not suspended.
deinit {
source.resume()
close(descriptor)
source.cancel()
}