summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorDebao Zhang <dbzhang800@gmail.com>2011-12-13 14:09:16 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-12-13 14:12:41 (GMT)
commit00bbab0dbfde79cfc6a3dc6060d7c87763f07482 (patch)
treec1676f4b4d0fa8b1cc4491a487052fb2e9e940c1 /src/gui/widgets
parenta5624473503cfb1bb56c7d6ed0da96ebca0dd8c9 (diff)
downloadQt-00bbab0dbfde79cfc6a3dc6060d7c87763f07482.zip
Qt-00bbab0dbfde79cfc6a3dc6060d7c87763f07482.tar.gz
Qt-00bbab0dbfde79cfc6a3dc6060d7c87763f07482.tar.bz2
Fix Memoy leak relateded to contextmenu.
From Qt4.7 on, the contextmenu of QTextEdit/QPlainTextEdit/QLineEdit/QLabel/QMainWindow etc using QMenu::popup() instead of QMenu::exec(), but the setAttribute(Qt::WA_DeleteOnClose) does not work, as QMenu::close() isn't called when the menus disapper. And this causes a memory leak. Task-number: QTBUG-22817 Merge-request: 2721 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qmenu.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index a490286..eb57caa 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -513,7 +513,7 @@ void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister)
menu->blockSignals(false);
#endif // QT_NO_EFFECTS
if (!justRegister)
- menu->hide();
+ menu->close();
}
void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst)