projects
/
oweals
/
dinit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b3291e
)
Add service set destructor.
author
Davin McCall
<davmac@davmac.org>
Fri, 29 Sep 2017 19:26:05 +0000
(20:26 +0100)
committer
Davin McCall
<davmac@davmac.org>
Sat, 30 Sep 2017 01:51:12 +0000
(
02:51
+0100)
Destructor deletes all services in the service set. This fixes a memory
leak currently present in the tests.
src/service.h
patch
|
blob
|
history
diff --git
a/src/service.h
b/src/service.h
index b9c84711812149250e2c5439d08199e9c89c18e6..8a193704bad9762bf02dfc35d60ebac89b1f89a6 100644
(file)
--- 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)
{