From f08071a52e726b153aa02d394dfa2079baa05993 Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 22 Nov 2015 10:39:34 +0100 Subject: [PATCH] corrected template cleanup (previous commit) --- src/ebusd/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ebusd/main.cpp b/src/ebusd/main.cpp index 9f4ccdff..2bb9ded6 100644 --- a/src/ebusd/main.cpp +++ b/src/ebusd/main.cpp @@ -460,6 +460,7 @@ void shutdown() for (map::iterator it = templatesByPath.begin(); it != templatesByPath.end(); it++) { if (it->second!=&globalTemplates) delete it->second; + it->second = NULL; } templatesByPath.clear(); @@ -641,7 +642,8 @@ result_t loadConfigFiles(MessageMap* messages, bool verbose) messages->clear(); globalTemplates.clear(); for (map::iterator it = templatesByPath.begin(); it != templatesByPath.end(); it++) { - delete it->second; + if (it->second!=&globalTemplates) + delete it->second; it->second = NULL; } templatesByPath.clear();