1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 02:09:48 +01:00

* Fixed shutdown sequence while ongoing database replication.

This commit is contained in:
Christian Muehlhaeuser 2011-09-12 07:16:47 +02:00
parent 2b8a1fa2ca
commit 2c9c5ea8bb
3 changed files with 13 additions and 20 deletions

View File

@ -30,7 +30,6 @@
DatabaseWorker::DatabaseWorker( DatabaseImpl* lib, Database* db, bool mutates )
: QThread()
, m_dbimpl( lib )
, m_abort( false )
, m_outstanding( 0 )
{
Q_UNUSED( db );
@ -44,12 +43,12 @@ DatabaseWorker::DatabaseWorker( DatabaseImpl* lib, Database* db, bool mutates )
DatabaseWorker::~DatabaseWorker()
{
qDebug() << Q_FUNC_INFO << m_outstanding;
tDebug() << Q_FUNC_INFO << m_outstanding;
if ( m_commands.count() )
qDebug() << "Outstanding db commands to finish:" << m_commands;
if ( m_outstanding )
tDebug() << "Outstanding db commands to finish:" << m_commands;
quit();
thread()->quit();
wait();
}

View File

@ -1,5 +1,5 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk is free software: you can redistribute it and/or modify
@ -48,7 +48,7 @@ public:
public slots:
void enqueue( const QSharedPointer<DatabaseCommand>& );
protected:
void run();
@ -61,8 +61,6 @@ private:
QMutex m_mut;
DatabaseImpl* m_dbimpl;
QList< QSharedPointer<DatabaseCommand> > m_commands;
bool m_abort;
int m_outstanding;
QJson::Serializer m_serializer;

View File

@ -271,17 +271,8 @@ TomahawkApp::~TomahawkApp()
if ( !m_scanManager.isNull() )
delete m_scanManager.data();
#ifndef TOMAHAWK_HEADLESS
delete m_mainwindow;
#endif
#ifdef LIBATTICA_FOUND
delete AtticaManager::instance();
#endif
if ( !m_audioEngine.isNull() )
delete m_audioEngine.data();
if ( !m_infoSystem.isNull() )
delete m_infoSystem.data();
@ -289,14 +280,19 @@ TomahawkApp::~TomahawkApp()
delete SipHandler::instance();
if ( !m_scanManager.isNull() )
delete m_scanManager.data();
if ( !m_database.isNull() )
delete m_database.data();
Pipeline::instance()->stop();
delete Pipeline::instance();
#ifndef TOMAHAWK_HEADLESS
delete m_mainwindow;
#endif
#ifdef LIBATTICA_FOUND
delete AtticaManager::instance();
#endif
tLog() << "Finished shutdown.";
}