diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-12 14:16:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 14:16:52 +0200 |
commit | c28d7813445a897a371105ddb8f42ee68fafea0c (patch) | |
tree | 29e4202a2b47505fe1dcfb0b6507cbb7f5d421e8 /core/io/file_access_encrypted.cpp | |
parent | 603b1315a711f427a581445c9680116bee0ef755 (diff) | |
parent | d2ebac3a302f41223ab86f5bc2862dd3a050a010 (diff) |
Merge pull request #60169 from bruvzg/remove_fa_close
Diffstat (limited to 'core/io/file_access_encrypted.cpp')
-rw-r--r-- | core/io/file_access_encrypted.cpp | 24 |
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(); } |