AppleReloadManager::~AppleReloadManager() { //Unregister from file system FSEventStreamStop(stream); FSEventStreamUnscheduleFromRunLoop(stream,CFRunLoopGetCurrent(),kCFRunLoopDefaultMode); FSEventStreamInvalidate(stream); FSEventStreamRelease(stream); //Destory the lock pthread_mutex_destroy(&AppleReloadManager::reloadMutex); }
void FDirectoryWatchRequestMac::Shutdown( void ) { if( bRunning ) { check(EventStream); FSEventStreamStop(EventStream); FSEventStreamUnscheduleFromRunLoop(EventStream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); FSEventStreamInvalidate(EventStream); FSEventStreamRelease(EventStream); bRunning = false; } }
void FSEventsEventPublisher::stop() { // Stop the stream. if (stream_ != nullptr) { FSEventStreamStop(stream_); stream_started_ = false; FSEventStreamUnscheduleFromRunLoop( stream_, run_loop_, kCFRunLoopDefaultMode); FSEventStreamInvalidate(stream_); FSEventStreamRelease(stream_); stream_ = nullptr; } // Stop the run loop. if (run_loop_ != nullptr) { CFRunLoopStop(run_loop_); } }
void FSEventsEventPublisher::stop() { // Stop the stream. WriteLock lock(mutex_); if (run_loop_ == nullptr) { // No need to stop if there is not run loop. return; } if (stream_ != nullptr) { FSEventStreamStop(stream_); stream_started_ = false; FSEventStreamUnscheduleFromRunLoop( stream_, run_loop_, kCFRunLoopDefaultMode); FSEventStreamInvalidate(stream_); FSEventStreamRelease(stream_); stream_ = nullptr; } // Stop the run loop. CFRunLoopStop(run_loop_); }