Skip to content

Commit 0e5800e

Browse files
committed
Shut down GUI properly in all cases
1 parent b0370b8 commit 0e5800e

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

Source/Main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class OpenEphysApplication : public JUCEApplication
105105
//==============================================================================
106106
void systemRequestedQuit()
107107
{
108+
mainWindow->shutDownGUI();
108109
//std::cout << "Quit requested" << std::endl;
109110
quit();
110111
}

Source/MainWindow.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,20 @@ MainWindow::~MainWindow()
124124
}
125125

126126
void MainWindow::closeButtonPressed()
127+
{
128+
129+
JUCEApplication::getInstance()->systemRequestedQuit();
130+
131+
}
132+
133+
void MainWindow::shutDownGUI()
127134
{
128135
if (audioComponent->callbacksAreActive())
129136
{
130137
audioComponent->endCallbacks();
131138
}
132139

133140
processorGraph->disableProcessors();
134-
135-
JUCEApplication::getInstance()->systemRequestedQuit();
136-
137141
}
138142

139143
void MainWindow::saveWindowBounds()

Source/MainWindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class MainWindow : public DocumentWindow
6262
/** Determines whether the last used configuration reloads upon startup. */
6363
bool shouldReloadOnStartup;
6464

65+
void shutDownGUI();
66+
6567
private:
6668

6769
/** Saves the MainWindow's boundaries into the file "windowState.xml", located in the directory

0 commit comments

Comments
 (0)