diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-04-12 11:15:02 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-04-12 14:50:14 +0300 |
commit | d2ebac3a302f41223ab86f5bc2862dd3a050a010 (patch) | |
tree | a360d9c508dacd4d00ce9ca9525a1b8c83a5bdd7 /drivers/unix | |
parent | 788f355ad2f8c1826f5e55477249934d45d62891 (diff) |
Remove or make private `FileAccess` `close()` methods.
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/file_access_unix.cpp | 9 | ||||
-rw-r--r-- | drivers/unix/file_access_unix.h | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 99da292e12..e0b2994b63 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -71,10 +71,7 @@ void FileAccessUnix::check_errors() const { } Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) { - if (f) { - fclose(f); - } - f = nullptr; + _close(); path_src = p_path; path = fix_path(p_path); @@ -148,7 +145,7 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) { return OK; } -void FileAccessUnix::close() { +void FileAccessUnix::_close() { if (!f) { return; } @@ -343,7 +340,7 @@ Ref<FileAccess> FileAccessUnix::create_libc() { CloseNotificationFunc FileAccessUnix::close_notification_func = nullptr; FileAccessUnix::~FileAccessUnix() { - close(); + _close(); } #endif diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 692776915c..4340bbbc82 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -50,12 +50,12 @@ class FileAccessUnix : public FileAccess { String path_src; static Ref<FileAccess> create_libc(); + void _close(); public: static CloseNotificationFunc close_notification_func; virtual Error _open(const String &p_path, int p_mode_flags); ///< open a file - virtual void close(); ///< close a file virtual bool is_open() const; ///< true when file is open virtual String get_path() const; /// returns the path for the current open file |