[vlmc-devel] commit: TrackWorkflow: Don' t delete a ClipWorkflow to recreate it immediatly after. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Tue Sep 21 17:17:38 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Sep 21 16:45:59 2010 +0200| [51958a41568a8ef1cea6542e14817d3250a90fc0] | committer: 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

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=51958a41568a8ef1cea6542e14817d3250a90fc0
---

 src/Commands/Commands.cpp      |    8 ++++----
 src/Workflow/TrackWorkflow.cpp |    1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Commands/Commands.cpp b/src/Commands/Commands.cpp
index f162822..dfec8dc 100644
--- a/src/Commands/Commands.cpp
+++ b/src/Commands/Commands.cpp
@@ -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 );
diff --git a/src/Workflow/TrackWorkflow.cpp b/src/Workflow/TrackWorkflow.cpp
index 78faba3..0359bac 100644
--- a/src/Workflow/TrackWorkflow.cpp
+++ b/src/Workflow/TrackWorkflow.cpp
@@ -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;



More information about the Vlmc-devel mailing list