aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-14 19:36:16 (GMT)
committerHenrik Kinnunen <fluxgen@fluxbox.org>2008-09-14 19:36:16 (GMT)
commit91408776f0b04dbc5a5da99f555b33f9abc5a905 (patch)
tree6173a78017f7981ae1ad17825461907973a08777 /src/FbTk/Menu.cc
parent9f519ec0fcb7cd0dec61a4c31d246800f9a73cb3 (diff)
downloadfluxbox_pavel-91408776f0b04dbc5a5da99f555b33f9abc5a905.zip
fluxbox_pavel-91408776f0b04dbc5a5da99f555b33f9abc5a905.tar.bz2
Fixed a pixmap resource leak with selected pixmap in menus.
menu.hilite.selected.pixmap and menu.selected.pixmap was not deleted while switching between non-pixmap styles and pixmap styles.
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r--src/FbTk/Menu.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index f4e8f3d..7d50302 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -460,12 +460,24 @@ void Menu::updateMenu(int active_index) {
460 460
461 if (!theme()->selectedPixmap().pixmap().drawable()) { 461 if (!theme()->selectedPixmap().pixmap().drawable()) {
462 int hw = theme()->itemHeight() / 2; 462 int hw = theme()->itemHeight() / 2;
463 theme()->setSelectedPixmap(m_image_ctrl.renderImage(hw, hw, theme()->hiliteTexture()), true); 463 // render image, disable cache and let the theme remove the pixmap
464 theme()->setSelectedPixmap(m_image_ctrl.
465 renderImage(hw, hw,
466 theme()->hiliteTexture(), ROT0,
467 false // no cache
468 ),
469 false); // the theme takes care of this pixmap
464 470
465 if (!theme()->highlightSelectedPixmap().pixmap().drawable()) { 471 if (!theme()->highlightSelectedPixmap().pixmap().drawable()) {
466 int hw = theme()->itemHeight() / 2; 472 int hw = theme()->itemHeight() / 2;
467 theme()->setHighlightSelectedPixmap(m_image_ctrl.renderImage(hw, hw, theme()->frameTexture()), true); 473 // render image, disable cache and let the theme remove the pixmap
468 } 474 theme()->setHighlightSelectedPixmap(m_image_ctrl.
475 renderImage(hw, hw,
476 theme()->frameTexture(), ROT0,
477 false // no cache
478 ),
479 false); // theme takes care of this pixmap
480 }
469 } 481 }
470 482
471 if (m_title_vis) { 483 if (m_title_vis) {