Mixer: Destroy instances of Controller_Module when the connected modules are removed.
This commit is contained in:
parent
e9804033ab
commit
31f0d6b311
|
@ -71,7 +71,6 @@ Module::Module ( ) : Fl_Group( 0, 0, 50, 50, "Unnamed" )
|
|||
|
||||
Module::~Module ( )
|
||||
{
|
||||
|
||||
if ( _editor )
|
||||
{
|
||||
delete _editor;
|
||||
|
@ -84,7 +83,15 @@ Module::~Module ( )
|
|||
audio_output[i].disconnect();
|
||||
for ( unsigned int i = 0; i < control_input.size(); ++i )
|
||||
{
|
||||
control_input[i].disconnect();
|
||||
/* destroy connected Controller_Module */
|
||||
if ( control_input[i].connected() )
|
||||
{
|
||||
Module *o = (Module*)control_input[i].connected_port()->module();
|
||||
|
||||
control_input[i].disconnect();
|
||||
delete o;
|
||||
}
|
||||
|
||||
control_input[i].destroy_osc_port();
|
||||
}
|
||||
for ( unsigned int i = 0; i < control_output.size(); ++i )
|
||||
|
@ -95,6 +102,9 @@ Module::~Module ( )
|
|||
|
||||
control_input.clear();
|
||||
control_output.clear();
|
||||
|
||||
if ( parent() )
|
||||
parent()->remove( this );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue