@@ -27,17 +27,6 @@ | |||||
class Annotation_Point : public Sequence_Point | class Annotation_Point : public Sequence_Point | ||||
{ | { | ||||
public: | |||||
const char *name ( void ) const { return _label; } | |||||
void name ( const char *s ) | |||||
{ | |||||
if ( _label ) | |||||
free( _label ); | |||||
_label = strdup( s ); | |||||
redraw(); | |||||
} | |||||
protected: | protected: | ||||
// const char *class_name ( void ) { return "Annotation_Point"; } | // const char *class_name ( void ) { return "Annotation_Point"; } | ||||
@@ -101,7 +90,6 @@ public: | |||||
~Annotation_Point ( ) | ~Annotation_Point ( ) | ||||
{ | { | ||||
log_destroy(); | log_destroy(); | ||||
if ( _label ) free( _label ); | |||||
} | } | ||||
@@ -81,7 +81,7 @@ Audio_Sequence::set ( Log_Entry &e ) | |||||
t->track( this ); | t->track( this ); | ||||
} | } | ||||
else if ( ! strcmp( ":n", s ) ) | else if ( ! strcmp( ":n", s ) ) | ||||
name( strdup( v ) ); | |||||
name( v ); | |||||
} | } | ||||
} | } | ||||
@@ -238,6 +238,8 @@ Audio_Sequence::handle ( int m ) | |||||
return 0; | return 0; | ||||
} | } | ||||
free( file ); | |||||
// Audio_Region *r = | // Audio_Region *r = | ||||
new Audio_Region( c, this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - x() ) ); | new Audio_Region( c, this, timeline->xoffset + timeline->x_to_ts( Fl::event_x() - x() ) ); | ||||
@@ -86,7 +86,7 @@ Control_Sequence::set ( Log_Entry &e ) | |||||
t->add( this ); | t->add( this ); | ||||
} | } | ||||
else if ( ! strcmp( ":n", s ) ) | else if ( ! strcmp( ":n", s ) ) | ||||
name( strdup( v ) ); | |||||
name( v ); | |||||
} | } | ||||
} | } | ||||
@@ -348,6 +348,9 @@ Loggable::do_this ( const char *s, bool reverse ) | |||||
} | } | ||||
if ( arguments ) | |||||
free( arguments ); | |||||
return true; | return true; | ||||
} | } | ||||
@@ -58,7 +58,8 @@ Sequence::init ( void ) | |||||
Sequence::~Sequence ( ) | Sequence::~Sequence ( ) | ||||
{ | { | ||||
/* FIXME: what to do with regions? */ | |||||
if ( _name ) | |||||
free( _name ); | |||||
for ( std::list <Sequence_Widget*>::iterator i = _widgets.begin(); | for ( std::list <Sequence_Widget*>::iterator i = _widgets.begin(); | ||||
i != _widgets.end(); ++i ) | i != _widgets.end(); ++i ) | ||||
@@ -33,6 +33,15 @@ protected: | |||||
public: | public: | ||||
const char *name ( void ) const { return _label; } | |||||
void name ( const char *s ) | |||||
{ | |||||
if ( _label ) | |||||
free( _label ); | |||||
_label = strdup( s ); | |||||
redraw(); | |||||
} | |||||
Fl_Align align ( void ) const { return FL_ALIGN_RIGHT; } | Fl_Align align ( void ) const { return FL_ALIGN_RIGHT; } | ||||
virtual int abs_w ( void ) const { return 8; } | virtual int abs_w ( void ) const { return 8; } | ||||
@@ -63,6 +72,8 @@ public: | |||||
virtual ~Sequence_Point ( ) | virtual ~Sequence_Point ( ) | ||||
{ | { | ||||
if ( _label ) | |||||
free( _label ); | |||||
} | } | ||||
virtual void draw_box ( void ); | virtual void draw_box ( void ); | ||||
@@ -67,7 +67,6 @@ Tempo_Point::Tempo_Point ( nframes_t when, float bpm ) | |||||
Tempo_Point::~Tempo_Point ( ) | Tempo_Point::~Tempo_Point ( ) | ||||
{ | { | ||||
if ( _label ) delete[] _label; | |||||
log_destroy(); | log_destroy(); | ||||
} | } | ||||
@@ -30,7 +30,7 @@ class Tempo_Point : public Sequence_Point | |||||
_make_label ( void ) | _make_label ( void ) | ||||
{ | { | ||||
if ( ! _label ) | if ( ! _label ) | ||||
_label = new char[40]; | |||||
_label = (char*)malloc( 40 ); | |||||
snprintf( _label, 40, "%.1f", _tempo ); | snprintf( _label, 40, "%.1f", _tempo ); | ||||
} | } | ||||
@@ -51,7 +51,7 @@ class Time_Point : public Sequence_Point | |||||
_make_label ( void ) | _make_label ( void ) | ||||
{ | { | ||||
if ( ! _label ) | if ( ! _label ) | ||||
_label = new char[40]; | |||||
_label = (char*)malloc( 40 ); | |||||
snprintf( _label, 40, "%d/%d", _time.beats_per_bar, _time.beat_type ); | snprintf( _label, 40, "%d/%d", _time.beats_per_bar, _time.beat_type ); | ||||
} | } | ||||
@@ -94,7 +94,6 @@ public: | |||||
~Time_Point ( ) | ~Time_Point ( ) | ||||
{ | { | ||||
if ( _label ) delete[] _label; | |||||
log_destroy(); | log_destroy(); | ||||
} | } | ||||
@@ -259,10 +259,14 @@ Track::~Track ( ) | |||||
for ( int i = control_out.size(); i--; ) | for ( int i = control_out.size(); i--; ) | ||||
{ | { | ||||
control_out.back()->shutdown(); | control_out.back()->shutdown(); | ||||
delete control_out.back(); | |||||
control_out.pop_back(); | control_out.pop_back(); | ||||
} | } | ||||
log_destroy(); | log_destroy(); | ||||
if ( _name ) | |||||
free( _name ); | |||||
} | } | ||||