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.
This commit is contained in:
Neil Roberts 2010-09-29 15:40:22 +01:00
parent 54f5e168ec
commit a278a1f940

View File

@ -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,