diff options
author | simonb <simonb> | 2006-04-22 15:37:04 (GMT) |
---|---|---|
committer | simonb <simonb> | 2006-04-22 15:37:04 (GMT) |
commit | 932eebe0ddbc611ccf72cbebebbde656ae2d08ec (patch) | |
tree | d83c10c1393094cfcef80d29f12634e6a5f04430 | |
parent | 23cdfaaff3dcae62d50bddb087ecac94bca5be4c (diff) | |
download | fluxbox_paul-932eebe0ddbc611ccf72cbebebbde656ae2d08ec.zip fluxbox_paul-932eebe0ddbc611ccf72cbebebbde656ae2d08ec.tar.bz2 |
couple of memory fixes from valgrind
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/Keys.cc | 3 | ||||
-rw-r--r-- | src/MenuCreator.cc | 4 | ||||
-rw-r--r-- | src/Screen.cc | 5 |
4 files changed, 9 insertions, 5 deletions
@@ -1,6 +1,8 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.16: | 2 | Changes for 0.9.16: |
3 | *06/04/22: | 3 | *06/04/22: |
4 | * Couple of memory-based fixes from valgrind (Simon) | ||
5 | Keys.cc Screen.cc MenuCreator.cc | ||
4 | * Applied #1467926 and #1458069, minor other changes (Mathias) | 6 | * Applied #1467926 and #1458069, minor other changes (Mathias) |
5 | docs/asciidoc/fluxbox.txt | 7 | docs/asciidoc/fluxbox.txt |
6 | * static CommandParser could be used after destruction (Simon) | 8 | * static CommandParser could be used after destruction (Simon) |
diff --git a/src/Keys.cc b/src/Keys.cc index c4099f6..78ad912 100644 --- a/src/Keys.cc +++ b/src/Keys.cc | |||
@@ -117,8 +117,8 @@ void Keys::deleteTree() { | |||
117 | delete *it; | 117 | delete *it; |
118 | map_it->second->clear(); | 118 | map_it->second->clear(); |
119 | delete map_it->second; | 119 | delete map_it->second; |
120 | m_map.erase(map_it->first); | ||
121 | } | 120 | } |
121 | m_map.clear(); | ||
122 | } | 122 | } |
123 | 123 | ||
124 | /** | 124 | /** |
@@ -343,7 +343,6 @@ bool Keys::doAction(XKeyEvent &ke) { | |||
343 | returns true on success else false | 343 | returns true on success else false |
344 | */ | 344 | */ |
345 | bool Keys::reconfigure(const char *filename) { | 345 | bool Keys::reconfigure(const char *filename) { |
346 | deleteTree(); | ||
347 | return load(filename); | 346 | return load(filename); |
348 | } | 347 | } |
349 | 348 | ||
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 9d2b4fa..4a2cc0e 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc | |||
@@ -458,7 +458,7 @@ FbTk::Menu *MenuCreator::createMenuType(const std::string &type, int screen_num) | |||
458 | menu->disableTitle(); // not titlebar | 458 | menu->disableTitle(); // not titlebar |
459 | if (screen->windowMenuFilename().empty() || | 459 | if (screen->windowMenuFilename().empty() || |
460 | ! createWindowMenuFromFile(screen->windowMenuFilename(), *menu, true)) { | 460 | ! createWindowMenuFromFile(screen->windowMenuFilename(), *menu, true)) { |
461 | char default_menu[][11] = { | 461 | char *default_menu[] = { |
462 | "shade", | 462 | "shade", |
463 | "stick", | 463 | "stick", |
464 | "maximize", | 464 | "maximize", |
@@ -472,7 +472,7 @@ FbTk::Menu *MenuCreator::createMenuType(const std::string &type, int screen_num) | |||
472 | "close", | 472 | "close", |
473 | 0 | 473 | 0 |
474 | }; | 474 | }; |
475 | for (unsigned int i=0; i < sizeof(default_menu); ++i) | 475 | for (unsigned int i=0; default_menu[i]; ++i) |
476 | createWindowMenuItem(default_menu[i], "", *menu); | 476 | createWindowMenuItem(default_menu[i], "", *menu); |
477 | } | 477 | } |
478 | menu->reconfigure(); // update graphics | 478 | menu->reconfigure(); // update graphics |
diff --git a/src/Screen.cc b/src/Screen.cc index 4625b80..d19d16f 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -345,8 +345,11 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
345 | XSetErrorHandler((XErrorHandler) old); | 345 | XSetErrorHandler((XErrorHandler) old); |
346 | 346 | ||
347 | managed = running; | 347 | managed = running; |
348 | if (! managed) | 348 | if (! managed) { |
349 | delete m_placement_strategy; m_placement_strategy = 0; | ||
350 | delete m_focus_control; m_focus_control = 0; | ||
349 | return; | 351 | return; |
352 | } | ||
350 | 353 | ||
351 | // TODO fluxgen: check if this is the right place | 354 | // TODO fluxgen: check if this is the right place |
352 | m_head_areas = new HeadArea[numHeads() ? numHeads() : 1]; | 355 | m_head_areas = new HeadArea[numHeads() ? numHeads() : 1]; |