amend 5d0303b
- fix editor summary leak
This commit is contained in:
parent
8ca546ec88
commit
e19e6dc73a
@ -62,6 +62,11 @@ EditorSummary::EditorSummary (Editor* e)
|
|||||||
set_flags (get_flags() | Gtk::CAN_FOCUS);
|
set_flags (get_flags() | Gtk::CAN_FOCUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EditorSummary::~EditorSummary ()
|
||||||
|
{
|
||||||
|
cairo_surface_destroy (_image);
|
||||||
|
}
|
||||||
|
|
||||||
/** Handle a size allocation.
|
/** Handle a size allocation.
|
||||||
* @param alloc GTK allocation.
|
* @param alloc GTK allocation.
|
||||||
*/
|
*/
|
||||||
@ -102,14 +107,8 @@ EditorSummary::set_session (Session* s)
|
|||||||
void
|
void
|
||||||
EditorSummary::render_background_image ()
|
EditorSummary::render_background_image ()
|
||||||
{
|
{
|
||||||
int stride;
|
cairo_surface_destroy (_image); // passing NULL is safe
|
||||||
unsigned char *data;
|
_image = cairo_image_surface_create (CAIRO_FORMAT_RGB24, get_width (), get_height ());
|
||||||
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);
|
|
||||||
|
|
||||||
cairo_t* cr = cairo_create (_image);
|
cairo_t* cr = cairo_create (_image);
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ class EditorSummary : public CairoWidget, public EditorComponent, public ARDOUR:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EditorSummary (Editor *);
|
EditorSummary (Editor *);
|
||||||
|
~EditorSummary ();
|
||||||
|
|
||||||
void set_session (ARDOUR::Session *);
|
void set_session (ARDOUR::Session *);
|
||||||
void set_overlays_dirty ();
|
void set_overlays_dirty ();
|
||||||
|
Loading…
Reference in New Issue
Block a user