13
0

fix memory leak in editor summary.

This commit is contained in:
Robin Gareus 2014-10-10 16:18:03 +02:00
parent ac420ba87d
commit 5d0303b851

View File

@ -104,6 +104,9 @@ EditorSummary::render_background_image ()
{ {
int stride; int stride;
unsigned char *data; unsigned char *data;
if (_image) {
free (cairo_image_surface_get_data (_image));
}
stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, get_width ()); stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, get_width ());
data = (unsigned char*) malloc (stride * get_height ()); data = (unsigned char*) malloc (stride * get_height ());
_image = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_RGB24, get_width (), get_height (), stride); _image = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_RGB24, get_width (), get_height (), stride);