summaryrefslogtreecommitdiffstats
path: root/src/Config.cpp
diff options
context:
space:
mode:
authorJeroen BĂ©dorf <jeroen@bedorf.net>2015-04-02 12:04:31 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-04-30 15:53:53 +0200
commitbf31003d74f538a9096ef5999b31b0daa58c38c9 (patch)
treee26a563adbdab2fdbadadc01c5be5f46171b4def /src/Config.cpp
parent6fe3adab8ef3c9ab93a92c132f9809851a4dda74 (diff)
downloadastra-bf31003d74f538a9096ef5999b31b0daa58c38c9.tar.gz
astra-bf31003d74f538a9096ef5999b31b0daa58c38c9.tar.bz2
astra-bf31003d74f538a9096ef5999b31b0daa58c38c9.tar.xz
astra-bf31003d74f538a9096ef5999b31b0daa58c38c9.zip
Fix memory leak in the config
Diffstat (limited to 'src/Config.cpp')
-rw-r--r--src/Config.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Config.cpp b/src/Config.cpp
index d860638..32e5ed9 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -48,6 +48,7 @@ using namespace std;
Config::Config()
{
self = 0;
+ _doc = 0;
}
//-----------------------------------------------------------------------------
@@ -55,6 +56,7 @@ Config::Config()
Config::Config(XMLNode* _self)
{
self = _self;
+ _doc = 0;
}
//-----------------------------------------------------------------------------
@@ -62,6 +64,8 @@ Config::~Config()
{
delete self;
self = 0;
+ delete _doc;
+ _doc = 0;
}
//-----------------------------------------------------------------------------
@@ -70,6 +74,7 @@ void Config::initialize(std::string rootname)
if (self == 0) {
XMLDocument* doc = XMLDocument::createDocument(rootname);
self = doc->getRootNode();
+ _doc = doc;
}
}