summaryrefslogtreecommitdiff
path: root/platform/android/file_access_android.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-12 14:16:52 +0200
committerGitHub <noreply@github.com>2022-04-12 14:16:52 +0200
commitc28d7813445a897a371105ddb8f42ee68fafea0c (patch)
tree29e4202a2b47505fe1dcfb0b6507cbb7f5d421e8 /platform/android/file_access_android.cpp
parent603b1315a711f427a581445c9680116bee0ef755 (diff)
parentd2ebac3a302f41223ab86f5bc2862dd3a050a010 (diff)
Merge pull request #60169 from bruvzg/remove_fa_close
Diffstat (limited to 'platform/android/file_access_android.cpp')
-rw-r--r--platform/android/file_access_android.cpp6
1 files changed, 4 insertions, 2 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();
}