diff --git a/src/libtomahawk/database/databaseworker.cpp b/src/libtomahawk/database/databaseworker.cpp index 2a8997237..5634eddd6 100644 --- a/src/libtomahawk/database/databaseworker.cpp +++ b/src/libtomahawk/database/databaseworker.cpp @@ -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(); } diff --git a/src/libtomahawk/database/databaseworker.h b/src/libtomahawk/database/databaseworker.h index ea45cec0f..f4bfa2c70 100644 --- a/src/libtomahawk/database/databaseworker.h +++ b/src/libtomahawk/database/databaseworker.h @@ -1,5 +1,5 @@ /* === This file is part of Tomahawk Player - === - * + * * Copyright 2010-2011, Christian Muehlhaeuser * * Tomahawk is free software: you can redistribute it and/or modify @@ -48,7 +48,7 @@ public: public slots: void enqueue( const QSharedPointer& ); - + protected: void run(); @@ -61,8 +61,6 @@ private: QMutex m_mut; DatabaseImpl* m_dbimpl; QList< QSharedPointer > m_commands; - - bool m_abort; int m_outstanding; QJson::Serializer m_serializer; diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index 35fdab1d9..0a5dfb611 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -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."; }