From 5d0303b851363d138ee4760096aa6adfd9955f9a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 10 Oct 2014 16:18:03 +0200 Subject: fix memory leak in editor summary. --- gtk2_ardour/editor_summary.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gtk2_ardour/editor_summary.cc') diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 3057e58c64..641b060e17 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -104,6 +104,9 @@ EditorSummary::render_background_image () { int stride; unsigned char *data; + if (_image) { + free (cairo_image_surface_get_data (_image)); + } stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, get_width ()); data = (unsigned char*) malloc (stride * get_height ()); _image = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_RGB24, get_width (), get_height (), stride); -- cgit v1.2.3