From d2ebac3a302f41223ab86f5bc2862dd3a050a010 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 12 Apr 2022 11:15:02 +0300 Subject: Remove or make private `FileAccess` `close()` methods. --- core/io/file_access_encrypted.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'core/io/file_access_encrypted.cpp') 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 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(); } -- cgit v1.2.3