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 /platform | |
parent | 788f355ad2f8c1826f5e55477249934d45d62891 (diff) |
Remove or make private `FileAccess` `close()` methods.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/file_access_android.cpp | 6 | ||||
-rw-r--r-- | platform/android/file_access_android.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp index ee6eeaa849..d7ba31e3c9 100644 --- a/platform/android/file_access_android.cpp +++ b/platform/android/file_access_android.cpp @@ -39,6 +39,8 @@ Ref<FileAccess> FileAccessAndroid::create_android() { } Error FileAccessAndroid::_open(const String &p_path, int p_mode_flags) { + _close(); + String path = fix_path(p_path).simplify_path(); if (path.begins_with("/")) { path = path.substr(1, path.length()); @@ -58,7 +60,7 @@ Error FileAccessAndroid::_open(const String &p_path, int p_mode_flags) { return OK; } -void FileAccessAndroid::close() { +void FileAccessAndroid::_close() { if (!a) { return; } @@ -162,5 +164,5 @@ bool FileAccessAndroid::file_exists(const String &p_path) { } FileAccessAndroid::~FileAccessAndroid() { - close(); + _close(); } diff --git a/platform/android/file_access_android.h b/platform/android/file_access_android.h index ea7531e9ad..33b692da20 100644 --- a/platform/android/file_access_android.h +++ b/platform/android/file_access_android.h @@ -44,11 +44,12 @@ class FileAccessAndroid : public FileAccess { mutable uint64_t pos = 0; mutable bool eof = false; + void _close(); + public: static AAssetManager *asset_manager; 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 void seek(uint64_t p_position); ///< seek to a given position |