diff --git a/src/service/Resources.cpp b/src/service/Resources.cpp --- a/src/service/Resources.cpp +++ b/src/service/Resources.cpp @@ -56,7 +56,8 @@ Resources::Private::~Private() { - quit(); + requestInterruption(); + wait(1500); } namespace { @@ -66,7 +67,7 @@ void Resources::Private::run() { - forever { + while (!isInterruptionRequested()) { // initial delay before processing the events sleep(1); diff --git a/src/service/plugins/sqlite/ResourceScoreMaintainer.cpp b/src/service/plugins/sqlite/ResourceScoreMaintainer.cpp --- a/src/service/plugins/sqlite/ResourceScoreMaintainer.cpp +++ b/src/service/plugins/sqlite/ResourceScoreMaintainer.cpp @@ -58,14 +58,15 @@ ResourceScoreMaintainer::Private::~Private() { - quit(); + requestInterruption(); + wait(1500); } void ResourceScoreMaintainer::Private::run() { using namespace kamd::utils; - forever { + while (!isInterruptionRequested()) { // initial delay before processing the resources sleep(1);