diff options
Diffstat (limited to 'core/os/file_access.h')
-rw-r--r-- | core/os/file_access.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/os/file_access.h b/core/os/file_access.h index 0f85c447b6..0ee29abbc9 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -53,8 +53,8 @@ public: typedef void (*FileCloseFailNotify)(const String &); typedef FileAccess *(*CreateFunc)(); - bool endian_swap; - bool real_is_double; + bool endian_swap = false; + bool real_is_double = false; virtual uint32_t _get_unix_permissions(const String &p_file) = 0; virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) = 0; @@ -69,7 +69,7 @@ protected: private: static bool backup_save; - AccessType _access_type; + AccessType _access_type = ACCESS_FILESYSTEM; static CreateFunc create_func[ACCESS_MAX]; /** default file access creation function for a platform */ template <class T> static FileAccess *_create_builtin() { @@ -176,7 +176,7 @@ public: create_func[p_access] = _create_builtin<T>; } - FileAccess(); + FileAccess() {} virtual ~FileAccess() {} }; @@ -188,8 +188,11 @@ struct FileAccessRef { } operator bool() const { return f != nullptr; } + FileAccess *f; + operator FileAccess *() { return f; } + FileAccessRef(FileAccess *fa) { f = fa; } ~FileAccessRef() { if (f) |