diff --git a/FL/Fl_Flowpack.H b/FL/Fl_Flowpack.H index 85f037e..1df200f 100644 --- a/FL/Fl_Flowpack.H +++ b/FL/Fl_Flowpack.H @@ -36,6 +36,10 @@ public: _max_width = _hspacing = _vspacing = 0; } + virtual ~Fl_Flowpack ( ) + { + } + int max_width ( void ) const { return _max_width; } void vspacing ( int v ) { _vspacing = v; } diff --git a/Mixer/Mixer.C b/Mixer/Mixer.C index 23109db..f150eab 100644 --- a/Mixer/Mixer.C +++ b/Mixer/Mixer.C @@ -26,6 +26,7 @@ #include #include #include +#include #include "New_Project_Dialog.H" #include "Engine/Engine.H" #include "FL/Fl_Flowpack.H" @@ -78,6 +79,26 @@ void Mixer::cb_menu(Fl_Widget* o) { // write_line( user_config_dir, "default_path", default_path ); } + else if (! strcmp( picked, "&Project/&Open" ) ) + { + char *path = NULL; + +// read_line( user_config_dir, "default_path", &path ); + + const char *name = fl_dir_chooser( "Open Project", path, NULL ); + + free( path ); + + mixer->hide(); + + if ( int err = Project::open( name ) ) + { + fl_alert( "Error opening project: %s", Project::errstr( err ) ); + mixer->show(); + } + + mixer->show(); + } else if (! strcmp( picked, "&Project/&Save" ) ) { Project::save(); @@ -169,8 +190,10 @@ Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) : Mixer::~Mixer ( ) { - /* FIXME: teardown */ DMESSAGE( "Destroying mixer" ); + + /* FIXME: teardown */ + mixer_strips->clear(); } void Mixer::resize ( int X, int Y, int W, int H ) @@ -244,8 +267,6 @@ void Mixer::remove ( Mixer_Strip *ms ) mixer_strips->remove( ms ); - delete ms; - parent()->redraw(); } diff --git a/Mixer/Mixer_Strip.C b/Mixer/Mixer_Strip.C index 22e5bd1..62aa13e 100644 --- a/Mixer/Mixer_Strip.C +++ b/Mixer/Mixer_Strip.C @@ -182,6 +182,8 @@ Mixer_Strip::~Mixer_Strip ( ) _chain = NULL; log_destroy(); + + mixer->remove( this ); } void Mixer_Strip::cb_handle(Fl_Widget* o) { @@ -213,6 +215,7 @@ void Mixer_Strip::cb_handle(Fl_Widget* o) { if ( Fl::event_shift() || 1 == fl_choice( "Are you sure you want to remove this strip?\n\n(this action cannot be undone)", "Cancel", "Remove", NULL ) ) { ((Mixer*)parent())->remove( this ); + Fl::delete_widget( this ); } } else if ( o == name_field ) diff --git a/Mixer/Project.C b/Mixer/Project.C index 28e2846..e58e5e9 100644 --- a/Mixer/Project.C +++ b/Mixer/Project.C @@ -179,7 +179,7 @@ Project::close ( void ) if ( ! save() ) return false; -/* Loggable::close(); */ + Loggable::close(); /* // write_info(); */ _is_open = false; diff --git a/nonlib/Loggable.C b/nonlib/Loggable.C index 0fa91f4..af26fce 100644 --- a/nonlib/Loggable.C +++ b/nonlib/Loggable.C @@ -219,12 +219,11 @@ Loggable::close ( void ) { DMESSAGE( "closing journal and destroying all journaled objects" ); - if ( ! _fp ) - return true; - - fclose( _fp ); - - _fp = NULL; + if ( _fp ) + { + fclose( _fp ); + _fp = NULL; + } if ( ! snapshot( "snapshot" ) ) WARNING( "Failed to create snapshot" );