From fa5529b694ad4a75a9a1260a2c8416166a4ae7c1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 6 Mar 2014 23:17:04 -0500 Subject: [PATCH] fix missing Hit destructor, which left polygons all over the canvas after deleting the Hit object(s) --- gtk2_ardour/hit.cc | 5 +++++ gtk2_ardour/hit.h | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/hit.cc b/gtk2_ardour/hit.cc index de63e187e4..feb8ca43db 100644 --- a/gtk2_ardour/hit.cc +++ b/gtk2_ardour/hit.cc @@ -39,6 +39,11 @@ Hit::Hit (MidiRegionView& region, Group* group, double size, const boost::shared set_height (size); } +Hit::~Hit () +{ + delete _polygon; +} + void Hit::move_event (double dx, double dy) { diff --git a/gtk2_ardour/hit.h b/gtk2_ardour/hit.h index 3afdd91367..0ce1c93634 100644 --- a/gtk2_ardour/hit.h +++ b/gtk2_ardour/hit.h @@ -32,14 +32,14 @@ class Hit : public NoteBase public: typedef Evoral::Note NoteType; - Hit ( - MidiRegionView& region, - ArdourCanvas::Group* group, - double size, - const boost::shared_ptr note = boost::shared_ptr(), - bool with_events = true); + Hit (MidiRegionView& region, + ArdourCanvas::Group* group, + double size, + const boost::shared_ptr note = boost::shared_ptr(), + bool with_events = true); + ~Hit(); - void show (); + void show (); void hide (); ArdourCanvas::Coord x0 () const;