diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-04 13:41:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 13:41:38 +0100 |
commit | a0e33e17fbecc321d45306255814f9581504776c (patch) | |
tree | 966803124d47a23266ae3f81e57c7cf8f0456521 /core/io | |
parent | f83f1d7c9b299f21f818e0ea28c27345f65bde4b (diff) | |
parent | 1f209bfc41ef5f2cd63c961262d5d6fe3e03b55a (diff) |
Merge pull request #36733 from qarmin/static_analyzer_fixes
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; |