2021-08-08 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdservice(8) that could cause a segfault when
	restarting dropboxes.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-08-08 14:30:31 -04:00
parent a5c625d1a7
commit b2b5bf27bf
2 changed files with 13 additions and 5 deletions

View File

@@ -22190,3 +22190,6 @@
* Fixed a regression in rdadmin(1) that caused the 'Norm. Level'
and 'Autotrim Level' columns to display incorrect values in the
'Dropbox Configuration' dialog.
2021-08-08 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdservice(8) that could cause a segfault when
restarting dropboxes.

View File

@@ -2,7 +2,7 @@
//
// Shutdown routines for the Rivendell Services Manager
//
// (C) Copyright 2018 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2018-2021 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -42,13 +42,18 @@ void MainObject::Shutdown()
void MainObject::ShutdownDropboxes()
{
QList<int> kill_ids;
for(QMap<int,RDProcess *>::iterator it=svc_processes.begin();
it!=svc_processes.end();it++) {
if(it.key()>=RDSERVICE_FIRST_DROPBOX_ID) {
it.value()->process()->kill();
it.value()->process()->waitForFinished();
delete it.value();
svc_processes.erase(it);
kill_ids.push_back(it.key());
}
}
for(int i=0;i<kill_ids.size();i++) {
svc_processes.value(kill_ids.at(i))->process()->kill();
svc_processes.value(kill_ids.at(i))->process()->waitForFinished();
delete svc_processes.value(kill_ids.at(i));
svc_processes.remove(kill_ids.at(i));
}
}