summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_summary.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-10-10 16:18:03 +0200
committerRobin Gareus <robin@gareus.org>2014-10-10 16:18:03 +0200
commit5d0303b851363d138ee4760096aa6adfd9955f9a (patch)
treed3039ab42b650ed86796679207f697dda7d950ac /gtk2_ardour/editor_summary.cc
parentac420ba87d7c347d33125ce41782ac9c6548ff9b (diff)
fix memory leak in editor summary.
Diffstat (limited to 'gtk2_ardour/editor_summary.cc')
-rw-r--r--gtk2_ardour/editor_summary.cc3
1 files changed, 3 insertions, 0 deletions
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);