diff --git a/mixer/src/Mixer_Strip.C b/mixer/src/Mixer_Strip.C index 5f0274e..ed52b8b 100644 --- a/mixer/src/Mixer_Strip.C +++ b/mixer/src/Mixer_Strip.C @@ -351,12 +351,11 @@ Mixer_Strip::handle_module_added ( Module *m ) void Mixer_Strip::handle_module_removed ( Module *m ) { - if ( spatialization_controller->control_output[0].connected() && spatialization_controller->control_output[0].connected_port()->module() == m ) { - spatialization_controller->hide(); - DMESSAGE( "Module \"%s\" disconnected from spatialization controller", m->name() ); + set_spatializer_visibility(); + DMESSAGE( "Module \"%s\" disconnected from spatialization controller", m->label() ); } } diff --git a/mixer/src/Module.C b/mixer/src/Module.C index 8fa273d..1003693 100644 --- a/mixer/src/Module.C +++ b/mixer/src/Module.C @@ -58,9 +58,9 @@ Module::Module ( int W, int H, const char *L ) : Fl_Group( 0, 0, W, H, L ) Module::Module ( bool is_default, int W, int H, const char *L ) : Fl_Group( 0, 0, W, H, L ), Loggable( !is_default ) { - this->is_default( is_default ); - init(); + + this->is_default( is_default ); } Module::Module ( ) : Fl_Group( 0, 0, 50, 50, "Unnamed" ) @@ -88,9 +88,20 @@ Module::~Module ( ) if ( control_input[i].connected() ) { Module *o = (Module*)control_input[i].connected_port()->module(); + + if ( ! o->is_default() ) + { + control_input[i].disconnect(); + + DMESSAGE( "Deleting connected module %s", o->label() ); + + delete o; + } + else + { + control_input[i].disconnect(); + } - control_input[i].disconnect(); - delete o; } control_input[i].destroy_osc_port();