mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
* Destroy Pipeline properly and deactivate it earlier during shutdown.
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "artist.h"
|
#include "artist.h"
|
||||||
#include "album.h"
|
#include "album.h"
|
||||||
|
#include "pipeline.h"
|
||||||
#include "sourcelist.h"
|
#include "sourcelist.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
|
||||||
@@ -30,10 +31,14 @@ DatabaseCommand_Resolve::DatabaseCommand_Resolve( const query_ptr& query )
|
|||||||
: DatabaseCommand()
|
: DatabaseCommand()
|
||||||
, m_query( query )
|
, m_query( query )
|
||||||
{
|
{
|
||||||
|
Q_ASSERT( Pipeline::instance()->isRunning() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DatabaseCommand_Resolve::~DatabaseCommand_Resolve()
|
DatabaseCommand_Resolve::~DatabaseCommand_Resolve()
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DatabaseCommand_Resolve::exec( DatabaseImpl* lib )
|
DatabaseCommand_Resolve::exec( DatabaseImpl* lib )
|
||||||
|
@@ -61,6 +61,7 @@ Pipeline::Pipeline( QObject* parent )
|
|||||||
|
|
||||||
Pipeline::~Pipeline()
|
Pipeline::~Pipeline()
|
||||||
{
|
{
|
||||||
|
tDebug() << Q_FUNC_INFO;
|
||||||
m_running = false;
|
m_running = false;
|
||||||
|
|
||||||
// stop script resolvers
|
// stop script resolvers
|
||||||
|
@@ -48,6 +48,8 @@ public:
|
|||||||
explicit Pipeline( QObject* parent = 0 );
|
explicit Pipeline( QObject* parent = 0 );
|
||||||
virtual ~Pipeline();
|
virtual ~Pipeline();
|
||||||
|
|
||||||
|
bool isRunning() const { return m_running; }
|
||||||
|
|
||||||
unsigned int pendingQueryCount() const { return m_queries_pending.count(); }
|
unsigned int pendingQueryCount() const { return m_queries_pending.count(); }
|
||||||
unsigned int activeQueryCount() const { return m_qidsState.count(); }
|
unsigned int activeQueryCount() const { return m_qidsState.count(); }
|
||||||
|
|
||||||
|
@@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
#include "tomahawkapp.h"
|
#include "tomahawkapp.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include <QtCore/QPluginLoader>
|
#include <QtCore/QPluginLoader>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QMetaType>
|
#include <QtCore/QMetaType>
|
||||||
@@ -170,7 +168,7 @@ TomahawkApp::init()
|
|||||||
m_scanManager = QWeakPointer<ScanManager>( new ScanManager( this ) );
|
m_scanManager = QWeakPointer<ScanManager>( new ScanManager( this ) );
|
||||||
|
|
||||||
// init pipeline and resolver factories
|
// init pipeline and resolver factories
|
||||||
new Pipeline( this );
|
new Pipeline();
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
Pipeline::instance()->addExternalResolverFactory( boost::bind( &QtScriptResolver::factory, _1 ) );
|
Pipeline::instance()->addExternalResolverFactory( boost::bind( &QtScriptResolver::factory, _1 ) );
|
||||||
@@ -298,6 +296,8 @@ TomahawkApp::~TomahawkApp()
|
|||||||
{
|
{
|
||||||
tLog() << "Shutting down Tomahawk...";
|
tLog() << "Shutting down Tomahawk...";
|
||||||
|
|
||||||
|
Pipeline::instance()->stop();
|
||||||
|
|
||||||
if ( !m_servent.isNull() )
|
if ( !m_servent.isNull() )
|
||||||
delete m_servent.data();
|
delete m_servent.data();
|
||||||
if ( !m_scanManager.isNull() )
|
if ( !m_scanManager.isNull() )
|
||||||
@@ -313,8 +313,6 @@ TomahawkApp::~TomahawkApp()
|
|||||||
|
|
||||||
delete SipHandler::instance();
|
delete SipHandler::instance();
|
||||||
|
|
||||||
Pipeline::instance()->stop();
|
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
delete m_mainwindow;
|
delete m_mainwindow;
|
||||||
#ifdef LIBATTICA_FOUND
|
#ifdef LIBATTICA_FOUND
|
||||||
@@ -322,11 +320,11 @@ TomahawkApp::~TomahawkApp()
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
delete Pipeline::instance();
|
||||||
|
|
||||||
if ( !m_database.isNull() )
|
if ( !m_database.isNull() )
|
||||||
delete m_database.data();
|
delete m_database.data();
|
||||||
|
|
||||||
delete Pipeline::instance();
|
|
||||||
|
|
||||||
tLog() << "Finished shutdown.";
|
tLog() << "Finished shutdown.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,7 +462,6 @@ TomahawkApp::initHTTP()
|
|||||||
|
|
||||||
tLog() << "Starting HTTPd on" << m_session.listenInterface().toString() << m_session.port();
|
tLog() << "Starting HTTPd on" << m_session.listenInterface().toString() << m_session.port();
|
||||||
m_session.start();
|
m_session.start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -518,6 +515,7 @@ TomahawkApp::initServent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called after Servent emits ready()
|
// Called after Servent emits ready()
|
||||||
void
|
void
|
||||||
TomahawkApp::initSIP()
|
TomahawkApp::initSIP()
|
||||||
|
Reference in New Issue
Block a user