1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

* Call wipeIndex via a single-shot timer to avoid dead-locks.

This commit is contained in:
Christian Muehlhaeuser
2012-06-26 23:14:23 +02:00
parent cb578a607a
commit 9b09cbd11e
2 changed files with 10 additions and 11 deletions

View File

@@ -83,7 +83,7 @@ FuzzyIndex::wipeIndex()
endIndexing(); endIndexing();
QTimer::singleShot( 0, this, SLOT( updateIndex() ) ); QTimer::singleShot( 0, this, SLOT( updateIndex() ) );
return true; // FIXME return true; // FIXME
} }
@@ -189,8 +189,8 @@ FuzzyIndex::appendFields( const QMap< unsigned int, QMap< QString, QString > >&
catch( CLuceneError& error ) catch( CLuceneError& error )
{ {
tDebug() << "Caught CLucene error:" << error.what(); tDebug() << "Caught CLucene error:" << error.what();
wipeIndex(); QTimer::singleShot( 0, this, SLOT( wipeIndex() ) );
} }
} }
@@ -282,9 +282,9 @@ FuzzyIndex::search( const Tomahawk::query_ptr& query )
} }
catch( CLuceneError& error ) catch( CLuceneError& error )
{ {
tDebug() << "Caught CLucene error:" << error.what(); tDebug() << "Caught CLucene error:" << error.what() << query->toString();
wipeIndex(); QTimer::singleShot( 0, this, SLOT( wipeIndex() ) );
} }
return resultsmap; return resultsmap;
@@ -338,8 +338,8 @@ FuzzyIndex::searchAlbum( const Tomahawk::query_ptr& query )
catch( CLuceneError& error ) catch( CLuceneError& error )
{ {
tDebug() << "Caught CLucene error:" << error.what(); tDebug() << "Caught CLucene error:" << error.what();
wipeIndex(); QTimer::singleShot( 0, this, SLOT( wipeIndex() ) );
} }
return resultsmap; return resultsmap;

View File

@@ -61,7 +61,7 @@ public:
void beginIndexing(); void beginIndexing();
void endIndexing(); void endIndexing();
void appendFields( const QMap< unsigned int, QMap< QString, QString > >& trackData ); void appendFields( const QMap< unsigned int, QMap< QString, QString > >& trackData );
signals: signals:
void indexReady(); void indexReady();
@@ -73,10 +73,9 @@ public slots:
private slots: private slots:
void updateIndex(); void updateIndex();
private:
bool wipeIndex(); bool wipeIndex();
private:
QMutex m_mutex; QMutex m_mutex;
QString m_lucenePath; QString m_lucenePath;