diff options
author | Crazy-P <patrickolsen@myw.dk> | 2018-08-26 09:19:02 +0800 |
---|---|---|
committer | Crazy-P <patrickolsen@myw.dk> | 2018-08-26 09:19:02 +0800 |
commit | e4af39cbc00446b03d142882a69813e94f0838b2 (patch) | |
tree | 2b7ec12aeba47ce12e515795bfc6563148f11878 /drivers/gles3/rasterizer_scene_gles3.cpp | |
parent | 8c435a343e9739f30cb2e347df95835c91c1ff1a (diff) |
Fixes several resource leaks in ...
- gdscript
- gdscript_compiler
- regex
- android/export
- gles3/rasterizer (scene and storage)
Diffstat (limited to 'drivers/gles3/rasterizer_scene_gles3.cpp')
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); |