On 07/09/2009 01:33 AM, cvs@abisource.com wrote:
> +void GR_Graphics::createOffscreenBuffer(UT_uint32 x, UT_uint32 y, UT_uint32 width, UT_uint32 height)
> +{
> + cairo_surface_t* newBuffer = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); /////////////////
> + UT_uint32 newExtends[] = {x, y, width, height};
> + std::pair <cairo_surface_t*, UT_uint32*> tempPair (newBuffer, newExtends);
> + bufferContainer.push_front(tempPair);
> + setActiveBuffer(tempPair.first);
> +}
Frem,
this code above do something very bad. newExtends becomes invalid when
you leave the socpe. Yeah you store its pointer (which is on the stack)
into the "bufferContainer"
Also we have a convention that member variables are prefixed by "m_" and
this is obviously not done here.
Hub
Received on Thu Jul 9 08:04:11 2009
This archive was generated by hypermail 2.1.8 : Thu Jul 09 2009 - 08:04:11 CEST