[vlmc-devel] MainWorkflow: Don't heap alloc m_currentFrame

Hugo Beauzée-Luyssen git at videolan.org
Mon Mar 28 18:03:48 CEST 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 28 17:24:26 2016 +0200| [79d6b2e69a54816c8bd7fc8143c7d22d209117c0] | committer: Hugo Beauzée-Luyssen

MainWorkflow: Don't heap alloc m_currentFrame

Fixes a new[]/delete mismatch

> https://code.videolan.org/videolan/vlmc/commit/79d6b2e69a54816c8bd7fc8143c7d22d209117c0
---

 src/Workflow/MainWorkflow.cpp | 2 --
 src/Workflow/MainWorkflow.h   | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index a4904b7..c520240 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -49,7 +49,6 @@ MainWorkflow::MainWorkflow( int trackCount ) :
     m_currentFrameLock = new QReadWriteLock;
 
     m_tracks = new TrackHandler*[Workflow::NbTrackType];
-    m_currentFrame = new qint64[Workflow::NbTrackType];
     for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
     {
         Workflow::TrackType trackType = static_cast<Workflow::TrackType>(i);
@@ -65,7 +64,6 @@ MainWorkflow::MainWorkflow( int trackCount ) :
 MainWorkflow::~MainWorkflow()
 {
     delete m_currentFrameLock;
-    delete m_currentFrame;
     for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
         delete m_tracks[i];
     delete[] m_tracks;
diff --git a/src/Workflow/MainWorkflow.h b/src/Workflow/MainWorkflow.h
index cb0ee18..e3a8e01 100644
--- a/src/Workflow/MainWorkflow.h
+++ b/src/Workflow/MainWorkflow.h
@@ -301,7 +301,7 @@ class   MainWorkflow : public QObject, public ILoadSave
          *  m_currentFrame[MainWorkflow::VideoTrack], which is the value that will be used
          *  when setCurrentFrame() is called.
          */
-        qint64*                         m_currentFrame;
+        qint64                          m_currentFrame[Workflow::NbTrackType];
         /// The workflow length, in frame.
         qint64                          m_lengthFrame;
         /// This boolean describe is a render has been started



More information about the Vlmc-devel mailing list