Fix crash when failing to open log file for writing

(cherry picked from commit 7a5d61816c95c64a905e46480ffec3a5af880a5a)
This commit is contained in:
Aaron Franke authored and Thaddeus Crews committed 2026-07-30 11:26:20 -05:00
1 parent 3475e16164
commit 2906aa0e6d
1 file changed
+1
+1
View File
@@ -166,6 +166,7 @@ void RotatedFileLogger::rotate_file() {
}
file = FileAccess::open(base_path, FileAccess::WRITE);
ERR_FAIL_COND_MSG(file.is_null(), "Failed to open log file for writing: " + base_path);
file->detach_from_objectdb(); // Note: This FileAccess instance will exist longer than ObjectDB, therefore can't be registered in ObjectDB.
}