mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-14 03:59:35 -04:00
AutomatableModel: prevent linking of model to itself
There's no need to ever link a model to itself, allowing it can cause weird issues and crashes, plus it's easy to do by accident if you start a ctrl-drag and end it while still on the same widget
This commit is contained in:
@@ -394,7 +394,7 @@ float AutomatableModel::fittedValue( float value ) const
|
||||
|
||||
void AutomatableModel::linkModel( AutomatableModel* model )
|
||||
{
|
||||
if( !m_linkedModels.contains( model ) )
|
||||
if( !m_linkedModels.contains( model ) && model != this )
|
||||
{
|
||||
m_linkedModels.push_back( model );
|
||||
m_hasLinkedModels = true;
|
||||
@@ -426,8 +426,8 @@ void AutomatableModel::unlinkModel( AutomatableModel* model )
|
||||
|
||||
void AutomatableModel::linkModels( AutomatableModel* model1, AutomatableModel* model2 )
|
||||
{
|
||||
model1->linkModel( model2 );
|
||||
model2->linkModel( model1 );
|
||||
model1->linkModel( model2 );
|
||||
model2->linkModel( model1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user