[vlmc-devel] VLCSource, VmemRenderer: Delete snapshot in VLCSource

Yikai Lu git at videolan.org
Sun Apr 17 09:16:08 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Apr 12 22:09:32 2016 +0900| [e21729eecbeca822894c38190ab9ff521d73ad6c] | committer: Hugo Beauzée-Luyssen

VLCSource, VmemRenderer: Delete snapshot in VLCSource

It is used in VLCSource, which will be deleted after VmemRenderer

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/e21729eecbeca822894c38190ab9ff521d73ad6c
---

 src/Backend/VLC/VLCSource.cpp       | 6 ++++++
 src/Backend/VLC/VLCSource.h         | 1 +
 src/Backend/VLC/VLCVmemRenderer.cpp | 1 -
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Backend/VLC/VLCSource.cpp b/src/Backend/VLC/VLCSource.cpp
index d38d12f..eee870a 100644
--- a/src/Backend/VLC/VLCSource.cpp
+++ b/src/Backend/VLC/VLCSource.cpp
@@ -43,6 +43,12 @@ VLCSource::VLCSource( VLCBackend* backend, const QString& path )
     m_media = ::VLC::Media( backend->vlcInstance(), path.toStdString(), ::VLC::Media::FromPath );
 }
 
+VLCSource::~VLCSource()
+{
+    if ( m_snapshot )
+        delete[] m_snapshot;
+}
+
 ::VLC::Media&
 VLCSource::media()
 {
diff --git a/src/Backend/VLC/VLCSource.h b/src/Backend/VLC/VLCSource.h
index b2262df..4fee4dc 100644
--- a/src/Backend/VLC/VLCSource.h
+++ b/src/Backend/VLC/VLCSource.h
@@ -40,6 +40,7 @@ class VLCSource : public ISource
 {
 public:
     VLCSource( VLCBackend* backend, const QString& path );
+    virtual ~VLCSource();
     virtual ISourceRenderer*    createRenderer( ISourceRendererEventCb* callback );
     virtual bool                preparse();
     virtual bool                isParsed() const;
diff --git a/src/Backend/VLC/VLCVmemRenderer.cpp b/src/Backend/VLC/VLCVmemRenderer.cpp
index efbde63..58544ba 100644
--- a/src/Backend/VLC/VLCVmemRenderer.cpp
+++ b/src/Backend/VLC/VLCVmemRenderer.cpp
@@ -57,7 +57,6 @@ VmemRenderer::~VmemRenderer()
      * destroyed in a potentially locked state, while the vmem tries to lock/unlock.
      */
     stop();
-    delete[] m_snapshot;
 }
 
 ::VLC::MediaPlayer&



More information about the Vlmc-devel mailing list