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
This commit is contained in:
Javier Serrano Polo
2006-11-08 20:51:34 +00:00
parent 4ef77367d7
commit 250dcc82e0

View File

@@ -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: