summaryrefslogtreecommitdiff
path: root/core/io/file_access_encrypted.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/file_access_encrypted.cpp')
-rw-r--r--core/io/file_access_encrypted.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index 5d44ff3f10..d1b014a0be 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/core/io/file_access_encrypted.cpp
@@ -115,27 +115,11 @@ Error FileAccessEncrypted::_open(const String &p_path, int p_mode_flags) {
return OK;
}
-void FileAccessEncrypted::close() {
+void FileAccessEncrypted::_close() {
if (file.is_null()) {
return;
}
- _release();
-
- file.unref();
-}
-
-void FileAccessEncrypted::release() {
- if (file.is_null()) {
- return;
- }
-
- _release();
-
- file.unref();
-}
-
-void FileAccessEncrypted::_release() {
if (writing) {
Vector<uint8_t> compressed;
uint64_t len = data.size();
@@ -173,6 +157,8 @@ void FileAccessEncrypted::_release() {
file->store_buffer(compressed.ptr(), compressed.size());
data.clear();
}
+
+ file.unref();
}
bool FileAccessEncrypted::is_open() const {
@@ -309,7 +295,5 @@ Error FileAccessEncrypted::_set_unix_permissions(const String &p_file, uint32_t
}
FileAccessEncrypted::~FileAccessEncrypted() {
- if (file.is_valid()) {
- close();
- }
+ _close();
}