try to use relative paths for s_fonts map too as otherwise s_fonts.remove( m_filename ) won't do anything if a full path was inserted and m_filename was made relative - fixes crash when re-opening a soundfont which was shared before

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1625 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-09-17 09:52:51 +00:00
parent c54ba6a66a
commit 6f0645c66b
2 changed files with 14 additions and 3 deletions

View File

@@ -1,4 +1,15 @@
2008-09-08 Paul Giblock <drfaygo/at/gmail/dot/com>
2008-09-17 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/sf2_player/sf2_player.cpp:
try to use relative paths for s_fonts map too as otherwise
s_fonts.remove( m_filename ) won't do anything if a full path was
inserted and m_filename was made relative - fixes crash when
re-opening a soundfont which was shared before
* plugins/midi_import/portsmf/strparse.cpp:
fixed compilation issue
2008-09-16 Paul Giblock <drfaygo/at/gmail/dot/com>
* plugins/sf2_player/sf2_player.cpp:
* plugins/sf2_player/sf2_player.h:

View File

@@ -295,7 +295,7 @@ void sf2Instrument::freeFont( void )
{
cout << "Really deleting " << m_filename << endl;
sf2Instrument::s_fonts.remove( m_filename );
printf("%d\n", sf2Instrument::s_fonts.remove( m_filename ) );
fluid_synth_sfunload( m_synth, m_fontId, TRUE );
delete m_font;
@@ -352,7 +352,7 @@ void sf2Instrument::openFile( const QString & _sf2File )
{
// Grab this sf from the top of the stack and add to list
m_font = new sf2Font( fluid_synth_get_sfont( m_synth, 0 ) );
s_fonts.insert( _sf2File, m_font );
s_fonts.insert( sampleBuffer::tryToMakeRelative( _sf2File ), m_font );
}
else
{