2008-08-27 Emmanuele Bassi <ebassi@openedhand.com>

Bug 1082 - Texture bitmap is destroyed in wrong way

	* clutter/cogl/common/cogl-bitmap-pixbuf.c:
	(_cogl_bitmap_from_file): Make a copy of the pixbuf data in
	the internal image loader so that we can keep working under
	the assumption that we are using the GLib memory allocation
	and deallocation functions.
This commit is contained in:
Emmanuele Bassi 2008-08-27 12:56:54 +00:00
parent ef76d8e5e2
commit 6d07be1179

View File

@ -297,12 +297,14 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
if (pixels == NULL) return FALSE;
/* Store bitmap info */
bmp->data = pixels;
bmp->data = g_memdup (pixels, height * width * 4);
bmp->format = COGL_PIXEL_FORMAT_RGBA_8888;
bmp->width = width;
bmp->height = height;
bmp->rowstride = width * 4;
free (pixels);
return TRUE;
}
#endif