Commit 51958a41 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

TrackWorkflow: Don't delete a ClipWorkflow to recreate it immediatly after.

This fixes a crash when moving a clip with effects
parent 85045699
......@@ -92,8 +92,8 @@ void Commands::Clip::Move::redo()
{
if ( m_newTrack != m_oldTrack )
{
m_oldTrack->removeClip( m_clipHelper->uuid() );
m_newTrack->addClip( m_clipHelper, m_newPos );
ClipWorkflow *cw = m_oldTrack->removeClipWorkflow( m_clipHelper->uuid() );
m_newTrack->addClip( cw, m_newPos );
}
else
m_oldTrack->moveClip( m_clipHelper->uuid(), m_newPos );
......@@ -103,8 +103,8 @@ void Commands::Clip::Move::undo()
{
if ( m_newTrack != m_oldTrack )
{
m_newTrack->removeClip( m_clipHelper->uuid() );
m_oldTrack->addClip( m_clipHelper, m_oldPos );
ClipWorkflow *cw = m_newTrack->removeClipWorkflow( m_clipHelper->uuid() );
m_oldTrack->addClip( cw, m_oldPos );
}
else
m_newTrack->moveClip( m_clipHelper->uuid(), m_oldPos );
......
......@@ -438,6 +438,7 @@ ClipWorkflow* TrackWorkflow::removeClipWorkflow( const QUuid& id )
cw->disconnect();
m_clips.erase( it );
computeLength();
emit clipRemoved( this, cw->getClipHelper()->uuid() );
return cw;
}
++it;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment