summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthonyYoManz <anthony@anthony-arian.com>2019-04-25 21:59:07 +0100
committerAnthonyYoManz <anthony@anthony-arian.com>2019-04-25 21:59:07 +0100
commitfc65cc64b92d1663cf858f3c6cf4f039c2da67e8 (patch)
tree0ed53776b8b504165df2386ef1ff20dd25f44106
parentf05dce3ee2e1e42f27fa71a59c77da59e6a30a71 (diff)
Fix Crash On Close When 3D Is Disabled
-rw-r--r--scene/register_scene_types.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 9face3e476..47f5b152f0 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -782,7 +782,11 @@ void unregister_scene_types() {
ResourceLoader::remove_resource_format_loader(resource_loader_bmfont);
resource_loader_bmfont.unref();
+ //SpatialMaterial is not initialised when 3D is disabled, so it shouldn't be cleaned up either
+#ifndef _3D_DISABLED
SpatialMaterial::finish_shaders();
+#endif // _3D_DISABLED
+
ParticlesMaterial::finish_shaders();
CanvasItemMaterial::finish_shaders();
SceneStringNames::free();