diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-12 10:39:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 10:39:54 +0200 |
commit | f586e06f7b7b1066bc234198a6c11123927cb87c (patch) | |
tree | ea9684d5549f9fc9439ffaf438373f5ca5608a9a /core/io/file_access_compressed.cpp | |
parent | 2f7edae2b3064714b2e0fe8302366abc658955ce (diff) | |
parent | 4bf99f4af2c4918883c4382ead7de275fae21eea (diff) |
Merge pull request #60166 from bruvzg/narrow_file_access
Diffstat (limited to 'core/io/file_access_compressed.cpp')
-rw-r--r-- | core/io/file_access_compressed.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index 0c961ba8fb..ebd729cc64 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -63,7 +63,7 @@ Error FileAccessCompressed::open_after_magic(Ref<FileAccess> p_base) { cmode = (Compression::Mode)f->get_32(); block_size = f->get_32(); if (block_size == 0) { - f = Ref<FileAccess>(); + f.unref(); ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Can't open compressed file '" + p_base->get_path() + "' with block size 0, it is corrupted."); } read_total = f->get_32(); @@ -106,7 +106,7 @@ Error FileAccessCompressed::_open(const String &p_path, int p_mode_flags) { f = FileAccess::open(p_path, p_mode_flags, &err); if (err != OK) { //not openable - f = Ref<FileAccess>(); + f.unref(); return err; } @@ -126,7 +126,7 @@ Error FileAccessCompressed::_open(const String &p_path, int p_mode_flags) { rmagic[4] = 0; err = ERR_FILE_UNRECOGNIZED; if (magic != rmagic || (err = open_after_magic(f)) != OK) { - f = Ref<FileAccess>(); + f.unref(); return err; } } @@ -180,7 +180,7 @@ void FileAccessCompressed::close() { buffer.clear(); read_blocks.clear(); } - f = Ref<FileAccess>(); + f.unref(); } bool FileAccessCompressed::is_open() const { |