mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Fixed shutdown sequence while ongoing database replication.
This commit is contained in:
@@ -30,7 +30,6 @@
|
|||||||
DatabaseWorker::DatabaseWorker( DatabaseImpl* lib, Database* db, bool mutates )
|
DatabaseWorker::DatabaseWorker( DatabaseImpl* lib, Database* db, bool mutates )
|
||||||
: QThread()
|
: QThread()
|
||||||
, m_dbimpl( lib )
|
, m_dbimpl( lib )
|
||||||
, m_abort( false )
|
|
||||||
, m_outstanding( 0 )
|
, m_outstanding( 0 )
|
||||||
{
|
{
|
||||||
Q_UNUSED( db );
|
Q_UNUSED( db );
|
||||||
@@ -44,12 +43,12 @@ DatabaseWorker::DatabaseWorker( DatabaseImpl* lib, Database* db, bool mutates )
|
|||||||
|
|
||||||
DatabaseWorker::~DatabaseWorker()
|
DatabaseWorker::~DatabaseWorker()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << m_outstanding;
|
tDebug() << Q_FUNC_INFO << m_outstanding;
|
||||||
|
|
||||||
if ( m_commands.count() )
|
if ( m_outstanding )
|
||||||
qDebug() << "Outstanding db commands to finish:" << m_commands;
|
tDebug() << "Outstanding db commands to finish:" << m_commands;
|
||||||
|
|
||||||
quit();
|
thread()->quit();
|
||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void enqueue( const QSharedPointer<DatabaseCommand>& );
|
void enqueue( const QSharedPointer<DatabaseCommand>& );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void run();
|
void run();
|
||||||
|
|
||||||
@@ -61,8 +61,6 @@ private:
|
|||||||
QMutex m_mut;
|
QMutex m_mut;
|
||||||
DatabaseImpl* m_dbimpl;
|
DatabaseImpl* m_dbimpl;
|
||||||
QList< QSharedPointer<DatabaseCommand> > m_commands;
|
QList< QSharedPointer<DatabaseCommand> > m_commands;
|
||||||
|
|
||||||
bool m_abort;
|
|
||||||
int m_outstanding;
|
int m_outstanding;
|
||||||
|
|
||||||
QJson::Serializer m_serializer;
|
QJson::Serializer m_serializer;
|
||||||
|
@@ -271,17 +271,8 @@ TomahawkApp::~TomahawkApp()
|
|||||||
if ( !m_scanManager.isNull() )
|
if ( !m_scanManager.isNull() )
|
||||||
delete m_scanManager.data();
|
delete m_scanManager.data();
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
|
||||||
delete m_mainwindow;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LIBATTICA_FOUND
|
|
||||||
delete AtticaManager::instance();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( !m_audioEngine.isNull() )
|
if ( !m_audioEngine.isNull() )
|
||||||
delete m_audioEngine.data();
|
delete m_audioEngine.data();
|
||||||
|
|
||||||
if ( !m_infoSystem.isNull() )
|
if ( !m_infoSystem.isNull() )
|
||||||
delete m_infoSystem.data();
|
delete m_infoSystem.data();
|
||||||
|
|
||||||
@@ -289,14 +280,19 @@ TomahawkApp::~TomahawkApp()
|
|||||||
|
|
||||||
delete SipHandler::instance();
|
delete SipHandler::instance();
|
||||||
|
|
||||||
if ( !m_scanManager.isNull() )
|
|
||||||
delete m_scanManager.data();
|
|
||||||
if ( !m_database.isNull() )
|
if ( !m_database.isNull() )
|
||||||
delete m_database.data();
|
delete m_database.data();
|
||||||
|
|
||||||
Pipeline::instance()->stop();
|
Pipeline::instance()->stop();
|
||||||
delete Pipeline::instance();
|
delete Pipeline::instance();
|
||||||
|
|
||||||
|
#ifndef TOMAHAWK_HEADLESS
|
||||||
|
delete m_mainwindow;
|
||||||
|
#endif
|
||||||
|
#ifdef LIBATTICA_FOUND
|
||||||
|
delete AtticaManager::instance();
|
||||||
|
#endif
|
||||||
|
|
||||||
tLog() << "Finished shutdown.";
|
tLog() << "Finished shutdown.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user