From 33c63d011c07f09490c1fc76d92795f18c92b7e8 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 18 Oct 2008 14:59:27 +0000 Subject: [PATCH] do not mess around with global static pointers for a single instance of patchesDialog - create a local object instead (closes #2139701) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1772 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 4 ++++ plugins/sf2_player/sf2_player.cpp | 12 +++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6e585a3a..6d0ec536a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-10-18 Tobias Doerffel + * plugins/sf2_player/sf2_player.cpp: + do not mess around with global static pointers for a single instance + of patchesDialog - create a local object instead (closes #2139701) + * include/file_browser.h: * src/gui/file_browser.cpp: added filter feature allowing quick file access diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 451b282d9..cf5bcb4e8 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -298,7 +298,6 @@ void sf2Instrument::freeFont( void ) { cout << "Really deleting " << m_filename << endl; - printf("%d\n", sf2Instrument::s_fonts.remove( m_filename ) ); fluid_synth_sfunload( m_synth, m_fontId, TRUE ); delete m_font; @@ -994,22 +993,17 @@ void sf2InstrumentView::showFileDialog( void ) -// Single instance of the patch dialog -patchesDialog * sf2InstrumentView::s_patchDialog = NULL; void sf2InstrumentView::showPatchDialog( void ) { sf2Instrument * k = castModel(); - if( s_patchDialog == NULL ) - { - s_patchDialog = new patchesDialog( this ); - } + patchesDialog pd( this ); - s_patchDialog->setup( k->m_synth, 1, k->getInstrumentTrack()->name(), + pd.setup( k->m_synth, 1, k->getInstrumentTrack()->name(), &k->m_bankNum, &k->m_patchNum, m_patchLabel ); - s_patchDialog->exec(); + pd.exec(); }