makeCurrent when destroying ManagedDisplayWidgets

Fixes #1555
This commit is contained in:
itsmattkc
2021-04-08 18:59:04 +10:00
parent ba0eb2335b
commit abe28f81bf
10 changed files with 24 additions and 33 deletions
+5 -8
View File
@@ -29,19 +29,16 @@
namespace olive {
HistogramScope::HistogramScope(QWidget* parent) :
ScopeBase(parent)
{
}
#define super ScopeBase
HistogramScope::~HistogramScope()
HistogramScope::HistogramScope(QWidget* parent) :
super(parent)
{
OnDestroy();
}
void HistogramScope::OnInit()
{
ScopeBase::OnInit();
super::OnInit();
ShaderCode secondary_code(FileFunctions::ReadFileAsString(":/shaders/rgbhistogram_secondary.frag"),
FileFunctions::ReadFileAsString(":/shaders/rgbhistogram.vert"));
@@ -50,7 +47,7 @@ void HistogramScope::OnInit()
void HistogramScope::OnDestroy()
{
ScopeBase::OnDestroy();
super::OnDestroy();
pipeline_secondary_.clear();
texture_row_sums_ = nullptr;
+1 -1
View File
@@ -31,7 +31,7 @@ class HistogramScope : public ScopeBase
public:
HistogramScope(QWidget* parent = nullptr);
virtual ~HistogramScope() override;
MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(HistogramScope)
protected slots:
virtual void OnInit() override;
+6 -9
View File
@@ -24,18 +24,15 @@
namespace olive {
#define super ManagedDisplayWidget
ScopeBase::ScopeBase(QWidget* parent) :
ManagedDisplayWidget(parent),
super(parent),
buffer_(nullptr)
{
EnableDefaultContextMenu();
}
ScopeBase::~ScopeBase()
{
OnDestroy();
}
void ScopeBase::SetBuffer(Frame *frame)
{
buffer_ = frame;
@@ -45,7 +42,7 @@ void ScopeBase::SetBuffer(Frame *frame)
void ScopeBase::showEvent(QShowEvent* e)
{
ManagedDisplayWidget::showEvent(e);
super::showEvent(e);
UploadTextureFromBuffer();
}
@@ -92,7 +89,7 @@ void ScopeBase::UploadTextureFromBuffer()
void ScopeBase::OnInit()
{
ManagedDisplayWidget::OnInit();
super::OnInit();
UploadTextureFromBuffer();
@@ -114,7 +111,7 @@ void ScopeBase::OnPaint()
void ScopeBase::OnDestroy()
{
ManagedDisplayWidget::OnDestroy();
super::OnDestroy();
managed_tex_ = nullptr;
texture_ = nullptr;
+1 -1
View File
@@ -32,7 +32,7 @@ class ScopeBase : public ManagedDisplayWidget
public:
ScopeBase(QWidget* parent = nullptr);
virtual ~ScopeBase() override;
MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(ScopeBase)
public slots:
void SetBuffer(Frame* frame);
+3 -6
View File
@@ -33,14 +33,11 @@
namespace olive {
WaveformScope::WaveformScope(QWidget* parent) :
ScopeBase(parent)
{
}
#define super ScopeBase
WaveformScope::~WaveformScope()
WaveformScope::WaveformScope(QWidget* parent) :
super(parent)
{
OnDestroy();
}
ShaderCode WaveformScope::GenerateShaderCode()
+1 -1
View File
@@ -31,7 +31,7 @@ class WaveformScope : public ScopeBase
public:
WaveformScope(QWidget* parent = nullptr);
virtual ~WaveformScope() override;
MANAGEDDISPLAYWIDGET_DEFAULT_DESTRUCTOR(WaveformScope)
protected:
virtual ShaderCode GenerateShaderCode() override;