Commit eff251a8 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Solved crash when deleting a clipworkflow while rendering.

parent 7050701e
......@@ -201,7 +201,7 @@ AudioClipWorkflow::StackedBuffer::StackedBuffer( AudioClipWorkflow::AudioSample
void AudioClipWorkflow::StackedBuffer::release()
{
if ( m_mustRelease == true )
if ( m_mustRelease == true && m_poolHandler.isNull() == false )
m_poolHandler->releaseBuffer( m_buff );
delete this;
}
......@@ -26,8 +26,12 @@
#include "ClipWorkflow.h"
#include "StackedBuffer.hpp"
#include <QPointer>
class AudioClipWorkflow : public ClipWorkflow
{
Q_OBJECT
public:
struct AudioSample
{
......@@ -45,7 +49,7 @@ class AudioClipWorkflow : public ClipWorkflow
bool mustBeReleased = true);
virtual void release();
private:
AudioClipWorkflow* m_poolHandler;
QPointer<AudioClipWorkflow> m_poolHandler;
};
AudioClipWorkflow( Clip* clip );
......
......@@ -217,7 +217,7 @@ VideoClipWorkflow::StackedBuffer::StackedBuffer( LightVideoFrame *lvf,
void
VideoClipWorkflow::StackedBuffer::release()
{
if ( m_mustRelease == true )
if ( m_mustRelease == true && m_poolHandler.isNull() == false )
m_poolHandler->releaseBuffer( m_buff );
delete this;
}
......@@ -27,10 +27,14 @@
#include "StackedBuffer.hpp"
#include "Pool.hpp"
#include <QPointer>
class Clip;
class VideoClipWorkflow : public ClipWorkflow
{
Q_OBJECT
public:
class StackedBuffer : public ::StackedBuffer<LightVideoFrame*>
{
......@@ -39,7 +43,7 @@ class VideoClipWorkflow : public ClipWorkflow
bool mustBeReleased = true);
virtual void release();
private:
VideoClipWorkflow* m_poolHandler;
QPointer<VideoClipWorkflow> m_poolHandler;
};
VideoClipWorkflow( Clip* clip );
......
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