From a278a1f94053372d49fb31f82cac551f186a28f4 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 29 Sep 2010 15:40:22 +0100 Subject: [PATCH] cogl-texture-2d-sliced: Don't create the slice textures twice Both of the cogl_texture_2d_sliced_new functions called the slices_create function which creates the underlying GL textures. However this was also called by init_base so the textures would end up being created twice. This would make it leak the GL textures and the arrays which point to them. --- clutter/cogl/cogl/cogl-texture-2d-sliced.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/clutter/cogl/cogl/cogl-texture-2d-sliced.c b/clutter/cogl/cogl/cogl-texture-2d-sliced.c index adbbb14..51323df 100644 --- a/clutter/cogl/cogl/cogl-texture-2d-sliced.c +++ b/clutter/cogl/cogl/cogl-texture-2d-sliced.c @@ -1052,17 +1052,6 @@ _cogl_texture_2d_sliced_new_with_size (unsigned int width, return COGL_INVALID_HANDLE; } - if (!_cogl_texture_2d_sliced_slices_create (tex_2ds, - width, - height, - gl_intformat, - gl_format, - gl_type)) - { - _cogl_texture_2d_sliced_free (tex_2ds); - return COGL_INVALID_HANDLE; - } - tex_2ds->auto_mipmap = (flags & COGL_TEXTURE_NO_AUTO_MIPMAP) == 0; return _cogl_texture_2d_sliced_handle_new (tex_2ds); @@ -1121,13 +1110,6 @@ _cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp, internal_format)) goto error; - if (!_cogl_texture_2d_sliced_slices_create (tex_2ds, - width, height, - gl_intformat, - gl_format, - gl_type)) - goto error; - if (!_cogl_texture_2d_sliced_upload_to_gl (tex_2ds, dst_bmp, gl_intformat, -- 2.7.4