From e4af39cbc00446b03d142882a69813e94f0838b2 Mon Sep 17 00:00:00 2001 From: Crazy-P Date: Sun, 26 Aug 2018 09:19:02 +0800 Subject: Fixes several resource leaks in ... - gdscript - gdscript_compiler - regex - android/export - gles3/rasterizer (scene and storage) --- drivers/gles3/rasterizer_scene_gles3.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/gles3/rasterizer_scene_gles3.cpp') diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index eebdbe9493..88f14890ef 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -1008,7 +1008,10 @@ RID RasterizerSceneGLES3::light_instance_create(RID p_light) { light_instance->light = p_light; light_instance->light_ptr = storage->light_owner.getornull(p_light); - ERR_FAIL_COND_V(!light_instance->light_ptr, RID()); + if (!light_instance->light_ptr) { + memdelete(light_instance); + ERR_FAIL_COND_V(!light_instance->light_ptr, RID()); + } light_instance->self = light_instance_owner.make_rid(light_instance); -- cgit v1.2.3