diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-19 10:05:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 10:05:42 +0200 |
commit | e71cf83fbd1d303c48304d556e9ca975489cc8c5 (patch) | |
tree | 31f419c3c94e121e9366de81f1267aea8f6e177e /drivers | |
parent | bcd2f248ec04681c731ad0f90ad9869ac1745183 (diff) | |
parent | 99de3906ba1a42f1279634bc23258ce39828c5f6 (diff) |
Merge pull request #31470 from clayjohn/GLES2-skeleton-memory-leak
Check if skeleton texture is already allocated before reallocating
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index fd856e5fd7..8e026b96ce 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -3496,6 +3496,8 @@ RID RasterizerStorageGLES2::skeleton_create() { Skeleton *skeleton = memnew(Skeleton); + glGenTextures(1, &skeleton->tex_id); + return skeleton_owner.make_rid(skeleton); } @@ -3513,7 +3515,6 @@ void RasterizerStorageGLES2::skeleton_allocate(RID p_skeleton, int p_bones, bool skeleton->use_2d = p_2d_skeleton; if (config.float_texture_supported) { - glGenTextures(1, &skeleton->tex_id); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, skeleton->tex_id); |