Fix memory leaks in mru.cpp

Originally committed to SVN as r4348.
This commit is contained in:
Thomas Goyne 2010-05-23 06:58:06 +00:00
parent 9fc28fc1d4
commit 60a1bdc2df
1 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,7 @@ MRUManager::MRUManager(const std::string &config, const std::string &default_con
/// @todo Do something better here, maybe print the exact error
// std::cout << "json::Exception: " << e.what() << std::endl;
delete stream;
stream = new std::istringstream(default_config);
json::Reader::Read(root, *stream);
}
@ -68,6 +69,10 @@ MRUManager::MRUManager(const std::string &config, const std::string &default_con
MRUManager::~MRUManager() {
Flush();
for (MRUMap::iterator i = mru.begin(); i != mru.end(); ++i) {
delete i->second;
}
}