Mixer: Fix segfault in module paste.
This commit is contained in:
parent
15e095092c
commit
3a999ecc86
|
@ -190,8 +190,15 @@ Module::paste_before ( void )
|
|||
{
|
||||
Module *m = _copied_module_empty;
|
||||
|
||||
m->chain( chain() );
|
||||
Log_Entry le( _copied_module_settings );
|
||||
le.remove( ":chain" );
|
||||
|
||||
char *print = le.print();
|
||||
|
||||
DMESSAGE( "Pasting settings: %s", print );
|
||||
|
||||
free( print );
|
||||
|
||||
m->set( le );
|
||||
|
||||
if ( ! chain()->insert( this, m ) )
|
||||
|
@ -203,7 +210,7 @@ Module::paste_before ( void )
|
|||
_copied_module_settings = NULL;
|
||||
_copied_module_empty = NULL;
|
||||
|
||||
/* set up for another copy */
|
||||
/* set up for another paste */
|
||||
m->copy();
|
||||
}
|
||||
|
||||
|
@ -429,6 +436,26 @@ Module::set ( Log_Entry &e )
|
|||
|
||||
|
||||
|
||||
void
|
||||
Module::chain ( Chain *v )
|
||||
{
|
||||
if ( _chain != v )
|
||||
{
|
||||
DMESSAGE( "Adding module %s in to chain %s", label(), v ? v->name() : "NULL" );
|
||||
|
||||
_chain = v;
|
||||
|
||||
for ( int i = 0; i < ncontrol_inputs(); ++i )
|
||||
{
|
||||
control_input[i].update_osc_port();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DMESSAGE( "Module %s already belongs to chain %s", label(), v ? v->name() : "NULL" );
|
||||
}
|
||||
}
|
||||
|
||||
/* return a string serializing this module's parameter settings. The
|
||||
format is 1.0:2.0:... Where 1.0 is the value of the first control
|
||||
input, 2.0 is the value of the second control input etc.
|
||||
|
|
|
@ -373,18 +373,7 @@ public:
|
|||
}
|
||||
|
||||
Chain *chain ( void ) const { return _chain; }
|
||||
void chain ( Chain * v )
|
||||
{
|
||||
if ( _chain != v )
|
||||
{
|
||||
_chain = v;
|
||||
|
||||
for ( int i = 0; i < ncontrol_inputs(); ++i )
|
||||
{
|
||||
control_input[i].update_osc_port();
|
||||
}
|
||||
}
|
||||
}
|
||||
void chain ( Chain * v );
|
||||
|
||||
char *get_parameters ( void ) const;
|
||||
void set_parameters ( const char * );
|
||||
|
|
|
@ -280,6 +280,19 @@ Log_Entry::get ( int n, const char **name, const char **value ) const
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
Log_Entry::remove ( const char *name )
|
||||
{
|
||||
for ( int i = 0; i < _i; i++ )
|
||||
{
|
||||
if ( !strcmp( _sa[ i ], name ) )
|
||||
{
|
||||
free( _sa[i] );
|
||||
_sa[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char **
|
||||
Log_Entry::sa ( void )
|
||||
{
|
||||
|
|
|
@ -88,6 +88,9 @@ public:
|
|||
/* _sa.push( p ); \ */
|
||||
/* } \ */
|
||||
|
||||
|
||||
void remove ( const char *s );
|
||||
|
||||
ADD( int, "%d", v );
|
||||
ADD( nframes_t, "%lu", (unsigned long)v );
|
||||
ADD( unsigned long, "%lu", v );
|
||||
|
|
Loading…
Reference in New Issue