diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp index 427ce2c2cdc..69907a710aa 100644 --- a/core/io/resource_importer.cpp +++ b/core/io/resource_importer.cpp @@ -406,9 +406,14 @@ bool ResourceFormatImporter::are_import_settings_valid(const String &p_path) con } String ResourceFormatImporter::get_import_settings_hash() const { + + Vector > sorted_importers = importers; + + sorted_importers.sort_custom(); + String hash; - for (int i = 0; i < importers.size(); i++) { - hash += ":" + importers[i]->get_importer_name() + ":" + importers[i]->get_import_settings_string(); + for (int i = 0; i < sorted_importers.size(); i++) { + hash += ":" + sorted_importers[i]->get_importer_name() + ":" + sorted_importers[i]->get_import_settings_string(); } return hash.md5_text(); } diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index db1befb51eb..1d27d4dec34 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -77,7 +77,6 @@ public: void add_importer(const Ref &p_importer) { importers.push_back(p_importer); - importers.sort_custom(); } void remove_importer(const Ref &p_importer) { importers.erase(p_importer); } Ref get_importer_by_name(const String &p_name) const; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 754e8956a1a..67fba4f2785 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -531,6 +531,8 @@ void EditorNode::_sources_changed(bool p_exist) { if (waiting_for_first_scan) { + EditorResourcePreview::get_singleton()->start(); //start previes now that it's safe + _load_docks(); if (defer_load_scene != "") { diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 1fa1fe9070e..e0c292dc876 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -417,6 +417,10 @@ void EditorResourcePreview::check_for_invalidation(const String &p_path) { } } +void EditorResourcePreview::start() { + ERR_FAIL_COND(thread); + thread = Thread::create(_thread_func, this); +} void EditorResourcePreview::stop() { if (thread) { exit = true; @@ -428,13 +432,12 @@ void EditorResourcePreview::stop() { } EditorResourcePreview::EditorResourcePreview() { + thread = NULL; singleton = this; preview_mutex = Mutex::create(); preview_sem = Semaphore::create(); order = 0; exit = false; - - thread = Thread::create(_thread_func, this); } EditorResourcePreview::~EditorResourcePreview() { diff --git a/editor/editor_resource_preview.h b/editor/editor_resource_preview.h index 85ac78d58f2..c958bfbb74c 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -126,6 +126,7 @@ public: void remove_preview_generator(const Ref &p_generator); void check_for_invalidation(const String &p_path); + void start(); void stop(); EditorResourcePreview();