VstEffect: added NULL pointer check in closePlugin()

We must not call methods on m_plugin in case there's no valid instance
e.g. due to missing DLL files.

Closes #245.
This commit is contained in:
Tobias Doerffel
2014-02-06 20:58:30 +01:00
parent eccfc0c688
commit f44843d95c

View File

@@ -1,7 +1,7 @@
/*
* VstEffect.cpp - class for handling VST effect plugins
*
* Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -163,7 +163,7 @@ void VstEffect::openPlugin( const QString & _plugin )
void VstEffect::closePlugin()
{
m_pluginMutex.lock();
if( m_plugin->pluginWidget() != NULL )
if( m_plugin && m_plugin->pluginWidget() != NULL )
{
delete m_plugin->pluginWidget();
}