plasma: reset runners context before waiting

so that runners know that it is time for them to stop because the context
is no longer valid

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-18 22:28:17 +03:00
parent bd3425b187
commit df9bffd10c
2 changed files with 8 additions and 9 deletions

View file

@ -301,8 +301,8 @@ QString RunnerManager::query() const
void RunnerManager::reset() void RunnerManager::reset()
{ {
d->threadPool->waitForDone();
d->context.reset(); d->context.reset();
d->threadPool->waitForDone();
} }
} // Plasma namespace } // Plasma namespace

View file

@ -120,10 +120,9 @@ public:
/** /**
* Returns a list of all known Runner implementations * Returns a list of all known Runner implementations
* *
* @param parentApp the application to filter applets on. Uses the X-KDE-ParentApp entry * @param parentApp the application to filter applets on. Uses the X-KDE-ParentApp entry (if
* (if any) in the plugin info. The default value of QString() will result * any) in the plugin info. The default value of QString() will result in a
* in a list containing only applets not specifically registered to an * list containing only applets not specifically registered to an application.
* application.
* @return list of AbstractRunners * @return list of AbstractRunners
* @since 4.6 * @since 4.6
**/ **/
@ -131,8 +130,8 @@ public:
public Q_SLOTS: public Q_SLOTS:
/** /**
* Launch a query, this will create threads and return inmediately. When matches are found, * Launch a query, this will create threads and return inmediately. When matches are found, if
* if any, matchesChanged signal is emitted. * any, matchesChanged signal is emitted.
* *
* @param term the term we want to find matches for * @param term the term we want to find matches for
*/ */
@ -146,8 +145,8 @@ public Q_SLOTS:
Q_SIGNALS: Q_SIGNALS:
/** /**
* Emitted each time a new match is added to the list. The signal may * Emitted each time a new match is added to the list. The signal may not be emitted if not
* not be emitted if not matches are found. * matches are found.
*/ */
void matchesChanged(const QList<Plasma::QueryMatch> &matches); void matchesChanged(const QList<Plasma::QueryMatch> &matches);