From 48891a7de3311a53d782f80554662d99bd74a8dd Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 15 Aug 2010 12:34:10 +0200 Subject: [PATCH] VstPlugin: use guarded pointer for pluginWidget The pluginWidget of a VstPlugin (i.e. the VST editor) might be destroyed outside VstPlugin's control resulting in a dangling pointer. This leads to crashes for example when changing the model of an EffectView where a VST plugin is attached, i.e. when re-opening a InstrumentTrackWindow of an InstrumentTrack with a VST effect inside. This can be fixed easily by using QPointer. Closes #3045102. (cherry picked from commit f4b84a6058788efbc20fb0680929a52f6db0be7b) --- plugins/vst_base/VstPlugin.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/vst_base/VstPlugin.h b/plugins/vst_base/VstPlugin.h index c365b9253..bda769158 100644 --- a/plugins/vst_base/VstPlugin.h +++ b/plugins/vst_base/VstPlugin.h @@ -1,7 +1,7 @@ /* * VstPlugin.h - declaration of VstPlugin class * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2010 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,8 +25,9 @@ #ifndef _VST_PLUGIN_H #define _VST_PLUGIN_H -#include #include +#include +#include #include #include "mixer.h" @@ -107,7 +108,7 @@ private: QByteArray saveChunk(); QString m_plugin; - QWidget * m_pluginWidget; + QPointer m_pluginWidget; int m_pluginWindowID; QSize m_pluginGeometry;