Safely close database connections and delete backends

Also fix NewClosure leak caused by disconnected object signals
This commit is contained in:
Jonas Kvinge
2019-07-24 19:16:51 +02:00
parent bd78e8c275
commit b5eb13449b
47 changed files with 490 additions and 53 deletions

View File

@@ -989,7 +989,7 @@ void MainWindow::Exit() {
if (app_->player()->engine()->is_fadeout_enabled()) {
// To shut down the application when fadeout will be finished
connect(app_->player()->engine(), SIGNAL(FadeoutFinishedSignal()), qApp, SLOT(quit()));
connect(app_->player()->engine(), SIGNAL(FadeoutFinishedSignal()), this, SLOT(DoExit()));
if (app_->player()->GetState() == Engine::Playing) {
app_->player()->Stop();
hide();
@@ -998,6 +998,19 @@ void MainWindow::Exit() {
}
}
DoExit();
}
void MainWindow::DoExit() {
connect(app_, SIGNAL(ExitFinished()), this, SLOT(ExitFinished()));
app_->Exit();
}
void MainWindow::ExitFinished() {
qApp->quit();
}