Avoid potential crash if file watching resources are exhausted
Some checks are pending
Build Porymap / build-linux (5.14.2) (push) Waiting to run
Build Porymap / build-linux (6.8.2) (push) Waiting to run
Build Porymap / build-macos (macos-15-intel) (push) Waiting to run
Build Porymap / build-macos (macos-latest) (push) Waiting to run
Build Porymap / build-static-windows (push) Waiting to run

This commit is contained in:
GriffinR 2025-11-26 17:32:47 -05:00
parent 9bdb25e10d
commit d59b24bd6f

View File

@ -766,6 +766,7 @@ bool Project::watchFile(const QString &filename) {
if (!this->fileWatcher) {
// Only create the file watcher when it's first needed (even an empty QFileSystemWatcher will consume system resources).
this->fileWatcher = new QFileSystemWatcher(this);
if (!this->fileWatcher) return false;
QObject::connect(this->fileWatcher, &QFileSystemWatcher::fileChanged, this, &Project::recordFileChange);
}