From: Davin McCall Date: Fri, 29 Sep 2017 19:26:05 +0000 (+0100) Subject: Add service set destructor. X-Git-Tag: v0.06~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ca6348f5fcc46456d562f2a7711acec100707c58;p=oweals%2Fdinit.git Add service set destructor. Destructor deletes all services in the service set. This fixes a memory leak currently present in the tests. --- diff --git a/src/service.h b/src/service.h index b9c8471..8a19370 100644 --- a/src/service.h +++ b/src/service.h @@ -817,6 +817,13 @@ class service_set restart_enabled = true; } + virtual ~service_set() + { + for (auto * s : records) { + delete s; + } + } + // Start the specified service. The service will be marked active. void start_service(service_record *svc) {