Safely close database connections and delete backends
Also fix NewClosure leak caused by disconnected object signals
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QApplication>
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QtConcurrentRun>
|
||||
@@ -363,6 +364,10 @@ TagCompletionModel::TagCompletionModel(CollectionBackend *backend, Playlist::Col
|
||||
setStringList(backend->GetAll(col));
|
||||
}
|
||||
|
||||
if (QThread::currentThread() != backend->thread() && QThread::currentThread() != qApp->thread()) {
|
||||
backend->Close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QString TagCompletionModel::database_column(Playlist::Column column) {
|
||||
|
||||
Reference in New Issue
Block a user