From 67399702a0c73829cc734581517e2731e6609f83 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 20 Mar 2019 23:15:12 +1100 Subject: [PATCH] fixed crash with text effect --- effects/effect.cpp | 8 ++++---- effects/internal/texteffect.cpp | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/effects/effect.cpp b/effects/effect.cpp index 64386d2ff..5690000a9 100644 --- a/effects/effect.cpp +++ b/effects/effect.cpp @@ -893,6 +893,7 @@ GLuint Effect::process_superimpose(double timecode) { } if (texture == nullptr || texture->width() != img.width() || texture->height() != img.height()) { + delete_texture(); texture = new QOpenGLTexture(QOpenGLTexture::Target2D); @@ -903,6 +904,7 @@ GLuint Effect::process_superimpose(double timecode) { texture->allocateStorage(QOpenGLTexture::RGBA, QOpenGLTexture::UInt8); redrew_image = true; + } if (redrew_image) { @@ -1088,10 +1090,8 @@ bool Effect::valueHasChanged(double timecode) { } void Effect::delete_texture() { - if (texture != nullptr) { - delete texture; - texture = nullptr; - } + delete texture; + texture = nullptr; } const EffectMeta* get_meta_from_name(const QString& input) { diff --git a/effects/internal/texteffect.cpp b/effects/internal/texteffect.cpp index ee183f0b3..3fec335ad 100644 --- a/effects/internal/texteffect.cpp +++ b/effects/internal/texteffect.cpp @@ -299,8 +299,6 @@ void TextEffect::redraw(double timecode) { } void TextEffect::shadow_enable(bool e) { - close(); - shadow_color->SetEnabled(e); shadow_angle->SetEnabled(e); shadow_distance->SetEnabled(e);