diff options
author | qarmin <mikrutrafal54@gmail.com> | 2020-03-02 19:17:20 +0100 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2020-03-02 19:17:20 +0100 |
commit | 1f209bfc41ef5f2cd63c961262d5d6fe3e03b55a (patch) | |
tree | d754f5b7fad41653651ee820969ca484914c5fa3 /core/io | |
parent | 0c22f5a4476d80b43017b2032f60039ce75e49a9 (diff) |
Fixes bugs found by Sonarcloud and Coverity
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource_format_binary.cpp | 2 | ||||
-rw-r--r-- | core/io/resource_loader.cpp | 1 | ||||
-rw-r--r-- | core/io/resource_loader.h | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 54b75cc29d..efd452191a 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1008,7 +1008,9 @@ String ResourceLoaderBinary::recognize(FileAccess *p_f) { ResourceLoaderBinary::ResourceLoaderBinary() : translation_remapped(false), + ver_format(0), f(NULL), + importmd_ofs(0), error(OK) { progress = nullptr; diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 504dbe2d63..5dca8b3b89 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -538,6 +538,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p if (r_error) { *r_error = err; } + thread_load_mutex->unlock(); return RES(); } thread_load_mutex->unlock(); diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index 3b7a27f551..ea89917a5f 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -116,7 +116,7 @@ private: String type_hint; float progress = 0.0; ThreadLoadStatus status = THREAD_LOAD_IN_PROGRESS; - Error error; + Error error = OK; RES resource; bool xl_remapped = false; bool use_sub_threads = false; |