From 41f6a800bd690829c95fb5723e218e5249b1fa72 Mon Sep 17 00:00:00 2001 From: AnthonyYoManz Date: Thu, 25 Apr 2019 21:59:07 +0100 Subject: [PATCH] Fix Crash On Close When 3D Is Disabled (cherry picked from commit fc65cc64b92d1663cf858f3c6cf4f039c2da67e8) --- scene/register_scene_types.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 22a317060fc..3a823d3afe2 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -762,7 +762,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();