1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 09:01:15 +02:00

Don't crash on exit when showing Nyquist workbench

This commit is contained in:
Paul Licameli
2020-02-17 14:30:37 -05:00
parent 0fcb965b15
commit 77abcf1579
2 changed files with 7 additions and 0 deletions

View File

@@ -194,6 +194,8 @@ extern "C"
//Can happen if the menu item was never invoked. //Can happen if the menu item was never invoked.
//wxASSERT(gBench != NULL); //wxASSERT(gBench != NULL);
if (gBench) { if (gBench) {
// be sure to do this while gPrefs still exists:
gBench->SavePrefs();
gBench->Destroy(); gBench->Destroy();
gBench = NULL; gBench = NULL;
} }
@@ -863,6 +865,10 @@ NyqBench::NyqBench(wxWindow * parent)
} }
NyqBench::~NyqBench() NyqBench::~NyqBench()
{
}
void NyqBench::SavePrefs()
{ {
gPrefs->Write(wxT("NyqBench/Window/Maximized"), IsMaximized()); gPrefs->Write(wxT("NyqBench/Window/Maximized"), IsMaximized());
if (!IsMaximized()) { if (!IsMaximized()) {

View File

@@ -107,6 +107,7 @@ class NyqBench:public wxFrame
void ShowNyqBench(const CommandContext&); void ShowNyqBench(const CommandContext&);
static NyqBench *GetBench(); static NyqBench *GetBench();
void SavePrefs();
private: private:
void PopulateOrExchange(ShuttleGui & S); void PopulateOrExchange(ShuttleGui & S);