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;
	}
}
Exemplo n.º 3
0
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_);
  }
}
Exemplo n.º 4
0
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_);
}