diff --git a/src/io/fileview.cpp b/src/io/fileview.cpp index e2c841e0..b6e911f9 100644 --- a/src/io/fileview.cpp +++ b/src/io/fileview.cpp @@ -490,7 +490,9 @@ void FileView::updatePath() { } void FileView::updateWatchedFiles() { - delete this->watcher; + // If inotify events are sent to the watcher after deletion and deleteLater + // isn't used, a use after free in the QML engine will occur. + if (this->watcher) this->watcher->deleteLater(); if (!this->targetPath.isEmpty() && this->bWatchChanges) { qCDebug(logFileView) << "Creating watcher for" << this << "at" << this->targetPath;