summaryrefslogtreecommitdiffstats
path: root/core/resource.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-10-21 13:53:45 +0200
committerGitHub <noreply@github.com>2019-10-21 13:53:45 +0200
commit28eca3649d1aecf0845c70a3e722b7cfee517660 (patch)
treef1254ddb818e0fe4a28c57da3f2d3c674661fef7 /core/resource.h
parent119bf237209414a49879fba40459f22315ab1467 (diff)
parentb3cb58e7b37934ddb1a405b60ca1d81692ba8993 (diff)
downloadredot-engine-28eca3649d1aecf0845c70a3e722b7cfee517660.tar.gz
Merge pull request #30622 from creikey/fix-path-caching
PackedScene resources are freed before they are saved
Diffstat (limited to 'core/resource.h')
-rw-r--r--core/resource.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/resource.h b/core/resource.h
index 038b4f6278..3e1fe07137 100644
--- a/core/resource.h
+++ b/core/resource.h
@@ -84,9 +84,7 @@ protected:
void _set_path(const String &p_path);
void _take_over_path(const String &p_path);
-#ifdef TOOLS_ENABLED
- Map<String, int> id_for_path;
-#endif
+
public:
static Node *(*_get_local_scene_func)(); //used by editor
@@ -152,6 +150,10 @@ class ResourceCache {
friend class ResourceLoader; //need the lock
static RWLock *lock;
static HashMap<String, Resource *> resources;
+#ifdef TOOLS_ENABLED
+ static HashMap<String, HashMap<String, int> > resource_path_cache; // each tscn has a set of resource paths and IDs
+ static RWLock *path_cache_lock;
+#endif // TOOLS_ENABLED
friend void unregister_core_types();
static void clear();
friend void register_core_types();