diff options
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_fsevents.mm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm index e039559ea3..b6d285cec3 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.mm +++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm @@ -311,14 +311,16 @@ QFseventsFileSystemWatcherEngine::~QFseventsFileSystemWatcherEngine() { QMacAutoReleasePool pool; - // Stop the stream in case we have to wait for the lock below to be acquired. - if (stream) - FSEventStreamStop(stream); + dispatch_sync(queue, ^{ + // Stop the stream in case we have to wait for the lock below to be acquired. + if (stream) + FSEventStreamStop(stream); - // The assumption with the locking strategy is that this class cannot and will not be subclassed! - QMutexLocker locker(&lock); + // The assumption with the locking strategy is that this class cannot and will not be subclassed! + QMutexLocker locker(&lock); - stopStream(true); + stopStream(true); + }); dispatch_release(queue); } |