fixed too late initialization of member-variables - fixes crash

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@491 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2007-07-17 22:16:22 +00:00
parent 27e0df82c3
commit f54003ebab
2 changed files with 9 additions and 3 deletions

View File

@@ -1,5 +1,10 @@
2007-07-17 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* src/audio/audio_port.cpp:
initialize all member-variables in initialization-list of
audioPort-constructor - this way the audio-port isn't being added to
the mixer before it's completely initialized - fixes some segfaults
* include/midi.h:
* plugins/midi_import/midi_import.h:
* plugins/midi_import/midi_import.cpp:

View File

@@ -32,6 +32,7 @@
#include "audio_device.h"
#include "engine.h"
audioPort::audioPort( const QString & _name ) :
m_bufferUsage( NONE ),
m_firstBuffer( new surroundSampleFrame[
@@ -40,7 +41,9 @@ audioPort::audioPort( const QString & _name ) :
engine::getMixer()->framesPerAudioBuffer()] ),
m_extOutputEnabled( FALSE ),
m_nextFxChannel( -1 ),
m_name( "unnamed port" )
m_name( "unnamed port" ),
m_effects( new effectChain ),
m_frames( engine::getMixer()->framesPerAudioBuffer() )
{
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
engine::getMixer()->framesPerAudioBuffer() );
@@ -48,8 +51,6 @@ audioPort::audioPort( const QString & _name ) :
engine::getMixer()->framesPerAudioBuffer() );
engine::getMixer()->addAudioPort( this );
setExtOutputEnabled( TRUE );
m_frames = engine::getMixer()->framesPerAudioBuffer();
m_effects = new effectChain;
}