1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Don't manually delete the fuzzy index, instead rely on QObject parenting.

This commit is contained in:
Christian Muehlhaeuser 2012-06-04 21:07:12 +02:00
parent 2b3f850259
commit fc5fa6d4ea
3 changed files with 4 additions and 6 deletions

View File

@ -74,7 +74,7 @@ DatabaseImpl::DatabaseImpl( const QString& dbname, Database* parent )
// in case of unclean shutdown last time:
query.exec( "UPDATE source SET isonline = 'false'" );
m_fuzzyIndex = new FuzzyIndex( schemaUpdated );
m_fuzzyIndex = new FuzzyIndex( this, schemaUpdated );
if ( schemaUpdated )
QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
@ -113,8 +113,6 @@ DatabaseImpl::init()
DatabaseImpl::~DatabaseImpl()
{
delete m_fuzzyIndex;
tDebug() << "Shutting down database.";
/*

View File

@ -38,8 +38,8 @@ using namespace lucene::queryParser;
using namespace lucene::search;
FuzzyIndex::FuzzyIndex( bool wipeIndex )
: QObject()
FuzzyIndex::FuzzyIndex( QObject* parent, bool wipeIndex )
: QObject( parent )
, m_luceneReader( 0 )
, m_luceneSearcher( 0 )
{

View File

@ -55,7 +55,7 @@ class FuzzyIndex : public QObject
Q_OBJECT
public:
explicit FuzzyIndex( bool wipeIndex = false );
explicit FuzzyIndex( QObject* parent, bool wipeIndex = false );
~FuzzyIndex();
void beginIndexing();