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()
{
d->threadPool->waitForDone();
d->context.reset();
d->threadPool->waitForDone();
}
} // Plasma namespace

View file

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