From 7f02627290cedf2d5ef6b45cddc6117c763cb15b Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 13 Jun 2016 10:10:50 -0300 Subject: -Add visible IO errors when closing a file fails due to it being locked (most likely on windows), closes #4760 --- drivers/windows/file_access_windows.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/windows') diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 66181a6f44..3f27068fb2 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -131,6 +131,10 @@ void FileAccessWindows::close() { //atomic replace for existing file rename_error = !ReplaceFileW(save_path.c_str(), (save_path+".tmp").c_str(), NULL, 2|4, NULL, NULL); } + if (rename_error && close_fail_notify) { + close_fail_notify(save_path); + } + save_path=""; ERR_FAIL_COND( rename_error ); } -- cgit v1.2.3