couple of memory fixes from valgrind

This commit is contained in:
simonb 2006-04-22 15:37:04 +00:00
parent 23cdfaaff3
commit 932eebe0dd
4 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,8 @@
(Format: Year/Month/Day)
Changes for 0.9.16:
*06/04/22:
* Couple of memory-based fixes from valgrind (Simon)
Keys.cc Screen.cc MenuCreator.cc
* Applied #1467926 and #1458069, minor other changes (Mathias)
docs/asciidoc/fluxbox.txt
* static CommandParser could be used after destruction (Simon)

View file

@ -117,8 +117,8 @@ void Keys::deleteTree() {
delete *it;
map_it->second->clear();
delete map_it->second;
m_map.erase(map_it->first);
}
m_map.clear();
}
/**
@ -343,7 +343,6 @@ bool Keys::doAction(XKeyEvent &ke) {
returns true on success else false
*/
bool Keys::reconfigure(const char *filename) {
deleteTree();
return load(filename);
}

View file

@ -458,7 +458,7 @@ FbTk::Menu *MenuCreator::createMenuType(const std::string &type, int screen_num)
menu->disableTitle(); // not titlebar
if (screen->windowMenuFilename().empty() ||
! createWindowMenuFromFile(screen->windowMenuFilename(), *menu, true)) {
char default_menu[][11] = {
char *default_menu[] = {
"shade",
"stick",
"maximize",
@ -472,7 +472,7 @@ FbTk::Menu *MenuCreator::createMenuType(const std::string &type, int screen_num)
"close",
0
};
for (unsigned int i=0; i < sizeof(default_menu); ++i)
for (unsigned int i=0; default_menu[i]; ++i)
createWindowMenuItem(default_menu[i], "", *menu);
}
menu->reconfigure(); // update graphics

View file

@ -345,8 +345,11 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
XSetErrorHandler((XErrorHandler) old);
managed = running;
if (! managed)
if (! managed) {
delete m_placement_strategy; m_placement_strategy = 0;
delete m_focus_control; m_focus_control = 0;
return;
}
// TODO fluxgen: check if this is the right place
m_head_areas = new HeadArea[numHeads() ? numHeads() : 1];