From ca6348f5fcc46456d562f2a7711acec100707c58 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Fri, 29 Sep 2017 20:26:05 +0100 Subject: [PATCH] Add service set destructor. Destructor deletes all services in the service set. This fixes a memory leak currently present in the tests. --- src/service.h | 7 +++++++ 1 file changed, 7 insertions(+) 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) { -- 2.25.1