From b184bd04e8d9609cba4a88e95b3a20187367d26d Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 2 Jun 2009 18:01:18 +0100 Subject: [PATCH] [cogl-texture] Don't take ownership of the data in cogl_texture_new_from_bitmap When creating a Cogl texture from a Cogl bitmap it would steal the data by setting the bitmap_owner flag and clearing the data pointer from the bitmap. The data would be freed by the time the new_from_bitmap is finished. There is no reason to do this because the data will be freed when the Cogl bitmap is unref'd and it is confusing not to be able to reuse the bitmap for creating multiple textures. --- gl/cogl-texture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gl/cogl-texture.c b/gl/cogl-texture.c index ce2ee11ed..643b11899 100644 --- a/gl/cogl-texture.c +++ b/gl/cogl-texture.c @@ -1345,8 +1345,7 @@ cogl_texture_new_from_bitmap (CoglHandle bmp_handle, tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0); tex->bitmap = *bmp; - tex->bitmap_owner = TRUE; - bmp->data = NULL; + tex->bitmap_owner = FALSE; tex->slice_x_spans = NULL; tex->slice_y_spans = NULL;