summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-01-06 19:05:34 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-01-06 19:06:04 -0300
commitbfeaf27a3e41cd60ec7be4c1d88a3edd2c2a6d87 (patch)
tree6ec098fb30ffebac652838b9cd38abaa866306ea /servers
parent59f92e46b9271ed6c5e45f00961fb6066df8339a (diff)
Properly dispose of instance capture data, fixes #14795
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/visual_server_scene.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index 8dbb765f13..8d8bbb881f 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -659,7 +659,6 @@ void VisualServerScene::instance_set_use_lightmap(RID p_instance, RID p_lightmap
Instance *instance = instance_owner.get(p_instance);
ERR_FAIL_COND(!instance);
- ERR_FAIL_COND(!is_geometry_instance(instance->base_type));
if (instance->lightmap_capture) {
InstanceLightmapCaptureData *lightmap_capture = static_cast<InstanceLightmapCaptureData *>(((Instance *)instance->lightmap_capture)->base_data);
@@ -3298,6 +3297,7 @@ bool VisualServerScene::free(RID p_rid) {
Instance *instance = instance_owner.get(p_rid);
+ instance_set_use_lightmap(p_rid, RID(), RID());
instance_set_scenario(p_rid, RID());
instance_set_base(p_rid, RID());
instance_geometry_set_material_override(p_rid, RID());