From f3d7abfe32c3a5d9f480feec2cdf40cef69fa94b Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Thu, 28 Feb 2008 05:55:09 -0600 Subject: [PATCH] More work on cleaning up undo system. --- Region.H | 5 +++++ Tempo_Point.H | 5 ++++- Time_Point.H | 5 ++++- Track.C | 4 +++- Track_Point.H | 5 +++++ Track_Widget.H | 2 +- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Region.H b/Region.H index aea2947..0ef846d 100644 --- a/Region.H +++ b/Region.H @@ -157,6 +157,11 @@ public: } + ~Region ( ) + { + log_destroy(); + } + Fl_Boxtype box ( void ) const { return Region::_box; } Fl_Align align ( void ) const { return (Fl_Align)(FL_ALIGN_LEFT | FL_ALIGN_BOTTOM /*| FL_ALIGN_CLIP*/ | FL_ALIGN_INSIDE); } diff --git a/Tempo_Point.H b/Tempo_Point.H index 855312a..2cc3018 100644 --- a/Tempo_Point.H +++ b/Tempo_Point.H @@ -65,7 +65,10 @@ public: } ~Tempo_Point ( ) - { if ( _label ) delete[] _label; } + { + if ( _label ) delete[] _label; + log_destroy(); + } float tempo ( void ) const { return _tempo; } void tempo ( float v ) { _tempo = v; } diff --git a/Time_Point.H b/Time_Point.H index 794fab0..45c8769 100644 --- a/Time_Point.H +++ b/Time_Point.H @@ -78,7 +78,10 @@ public: } ~Time_Point ( ) - { if ( _label ) delete[] _label; } + { + if ( _label ) delete[] _label; + log_destroy(); + } /* beats_per_bar ( void ) const { return _time.beats_per_bar; } */ /* note_type ( void ) const { return _note_type; } */ diff --git a/Track.C b/Track.C index 85d874f..4850256 100644 --- a/Track.C +++ b/Track.C @@ -76,6 +76,8 @@ Track::draw ( void ) void Track::remove ( Track_Widget *r ) { + Logger _log( this ); + _widgets.remove( r ); } @@ -180,7 +182,7 @@ Track::handle ( int m ) if ( _queued_widget ) { - remove( _queued_widget ); +// remove( _queued_widget ); delete _queued_widget; _queued_widget = NULL; pushed = NULL; diff --git a/Track_Point.H b/Track_Point.H index 6a6110f..df572ba 100644 --- a/Track_Point.H +++ b/Track_Point.H @@ -43,6 +43,11 @@ public: _label = NULL; } + + virtual ~Track_Point ( ) + { + } + void draw ( int X, int Y, int W, int H ) { diff --git a/Track_Widget.H b/Track_Widget.H index a62b629..f2009e0 100644 --- a/Track_Widget.H +++ b/Track_Widget.H @@ -228,7 +228,7 @@ public: if ( Fl::event_state() & FL_CTRL && Fl::event_button() == 3 ) { - log_destroy(); +// log_destroy(); redraw(); _track->queue_delete( this );