Make FileAccess and DirAccess classes reference counted.

This commit is contained in:
bruvzg 2022-03-23 11:08:58 +02:00
parent ca9372622f
commit 9381acb6a4
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
193 changed files with 1122 additions and 1776 deletions

View file

@ -1765,8 +1765,8 @@ void DisplayServerWindows::swap_buffers() {
void DisplayServerWindows::set_native_icon(const String &p_filename) {
_THREAD_SAFE_METHOD_
FileAccess *f = FileAccess::open(p_filename, FileAccess::READ);
ERR_FAIL_COND_MSG(!f, "Cannot open file with icon '" + p_filename + "'.");
Ref<FileAccess> f = FileAccess::open(p_filename, FileAccess::READ);
ERR_FAIL_COND_MSG(f.is_null(), "Cannot open file with icon '" + p_filename + "'.");
ICONDIR *icon_dir = (ICONDIR *)memalloc(sizeof(ICONDIR));
int pos = 0;
@ -1852,7 +1852,6 @@ void DisplayServerWindows::set_native_icon(const String &p_filename) {
err = GetLastError();
ERR_FAIL_COND_MSG(err, "Error setting ICON_BIG: " + format_error_message(err) + ".");
memdelete(f);
memdelete(icon_dir);
}