From bc95b0b17145e0e8df7e92ae5bea689112afab85 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 16 Feb 2023 15:25:32 +0200 Subject: Restore FileAccess.close method. --- drivers/unix/file_access_unix.cpp | 4 ++++ drivers/unix/file_access_unix.h | 2 ++ drivers/windows/file_access_windows.cpp | 5 +++++ drivers/windows/file_access_windows.h | 2 ++ 4 files changed, 13 insertions(+) (limited to 'drivers') diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 43d3f53904..ee3cb876cf 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -318,6 +318,10 @@ Error FileAccessUnix::_set_unix_permissions(const String &p_file, uint32_t p_per return FAILED; } +void FileAccessUnix::close() { + _close(); +} + CloseNotificationFunc FileAccessUnix::close_notification_func = nullptr; FileAccessUnix::~FileAccessUnix() { diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 884fb9567f..79c4e73636 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -82,6 +82,8 @@ public: virtual uint32_t _get_unix_permissions(const String &p_file) override; virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override; + virtual void close() override; + FileAccessUnix() {} virtual ~FileAccessUnix(); }; diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index ea40622afc..0e51586b5a 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -375,6 +375,10 @@ Error FileAccessWindows::_set_unix_permissions(const String &p_file, uint32_t p_ return ERR_UNAVAILABLE; } +void FileAccessWindows::close() { + _close(); +} + FileAccessWindows::~FileAccessWindows() { _close(); } @@ -391,6 +395,7 @@ void FileAccessWindows::initialize() { reserved_file_index++; } } + void FileAccessWindows::finalize() { invalid_files.clear(); } diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h index 2b9960d494..453f8d3b5f 100644 --- a/drivers/windows/file_access_windows.h +++ b/drivers/windows/file_access_windows.h @@ -82,6 +82,8 @@ public: virtual uint32_t _get_unix_permissions(const String &p_file) override; virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override; + virtual void close() override; + static void initialize(); static void finalize(); -- cgit v1.2.3