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 f4b84a6058)
This commit is contained in:
Tobias Doerffel
2010-08-15 12:34:10 +02:00
parent 6a99bb11af
commit 48891a7de3

View File

@@ -1,7 +1,7 @@
/*
* VstPlugin.h - declaration of VstPlugin class
*
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* 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 <QtCore/QString>
#include <QtCore/QMutex>
#include <QtCore/QPointer>
#include <QtCore/QString>
#include <QtGui/QWidget>
#include "mixer.h"
@@ -107,7 +108,7 @@ private:
QByteArray saveChunk();
QString m_plugin;
QWidget * m_pluginWidget;
QPointer<QWidget> m_pluginWidget;
int m_pluginWindowID;
QSize m_pluginGeometry;