From 250dcc82e07782ade817e2604939f5a70dfe68e0 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Wed, 8 Nov 2006 20:51:34 +0000 Subject: [PATCH] fixed segfault when initializing some VST plugins git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@423 0778d3d1-df1d-0410-868b-ea421aaaa00d --- plugins/vst_base/lvsl_server.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/vst_base/lvsl_server.c b/plugins/vst_base/lvsl_server.c index 004801a80..778bdbbe4 100644 --- a/plugins/vst_base/lvsl_server.c +++ b/plugins/vst_base/lvsl_server.c @@ -130,10 +130,12 @@ void lvsMessage( const char * _fmt, ... ) class VSTPlugin { public: - VSTPlugin( const std::string & _plugin_file ); + VSTPlugin( void ); ~VSTPlugin(); + void init( const std::string & _plugin_file ); + void showEditor( void ) { if( m_window != NULL ) @@ -259,7 +261,7 @@ private: -VSTPlugin::VSTPlugin( const std::string & _plugin_file ) : +VSTPlugin::VSTPlugin( void ) : m_shortName( "" ), m_libInst( NULL ), m_plugin( NULL ), @@ -278,6 +280,13 @@ VSTPlugin::VSTPlugin( const std::string & _plugin_file ) : m_bpm( 0 ), m_sampleRate( 44100 ), m_currentSamplePos( 0 ) +{ +} + + + + +void VSTPlugin::init( const std::string & _plugin_file ) { if( load( _plugin_file ) == false ) { @@ -1172,7 +1181,8 @@ int main( void ) switch( cmd ) { case VST_LOAD_PLUGIN: - plugin = new VSTPlugin( readString() ); + plugin = new VSTPlugin(); + plugin->init( readString() ); break; case VST_SHOW_EDITOR: