mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdeui: unregister any registered jobs from KPlasmaJobTracker destructor
this is so that jobs are not left in the plasma applets as active when, for example, the program that has jobs registered is interrupted by a signal (be that ctrl+c or something nasty like SIGSEGV). KUiServerJobTracker was just warning about it but I can do better Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
77d32f4169
commit
aeef583555
1 changed files with 12 additions and 0 deletions
|
@ -81,6 +81,18 @@ KPlasmaJobTracker::KPlasmaJobTracker(QObject *parent)
|
|||
|
||||
KPlasmaJobTracker::~KPlasmaJobTracker()
|
||||
{
|
||||
const int registeredjobs = d->jobs.size();
|
||||
if (registeredjobs > 0) {
|
||||
// force-unregister any jobs in applets otherwise the interface for the jobs becomes
|
||||
// non-operational (there would be no jobs to stop anyway, this is the proxy to do it too)
|
||||
kWarning() << "there are" << registeredjobs << "registered jobs still";
|
||||
QMutableMapIterator<KJob*, QVariantMap> iter(d->jobs);
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
unregisterJob(iter.key());
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue