summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-09-20 13:23:15 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-09-20 13:25:06 (GMT)
commit0cbb1a488c4199ad06b8ab63a9d6bf09fc8a6911 (patch)
treefbe024e0c1d1c61b2cc1eea5b243fc4a7ef9c67b /src
parent7f11c900e9184565321c09533b468abb047129b8 (diff)
downloadQt-0cbb1a488c4199ad06b8ab63a9d6bf09fc8a6911.zip
Qt-0cbb1a488c4199ad06b8ab63a9d6bf09fc8a6911.tar.gz
Qt-0cbb1a488c4199ad06b8ab63a9d6bf09fc8a6911.tar.bz2
Fixed memory leak in Symbian when Options menu was launched.
Task-number: QTBUG-13437 Reviewed-by: Janne Koskinen
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index ab2bdea..83ba15a 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -168,11 +168,11 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QList<SymbianMe
if (action->action->menu()->actions().size() > 0) {
for (int c2= 0; c2 < action->action->menu()->actions().size(); ++c2) {
- QSymbianMenuAction *symbianAction2 = new QSymbianMenuAction;
+ QScopedPointer<QSymbianMenuAction> symbianAction2(new QSymbianMenuAction);
symbianAction2->action = action->action->menu()->actions().at(c2);
QMenu * menu = symbianAction2->action->menu();
symbianAction2->command = qt_symbian_menu_static_cmd_id++;
- qt_symbian_insert_action(symbianAction2, &(menuItem->children));
+ qt_symbian_insert_action(symbianAction2.data(), &(menuItem->children));
}
}
@@ -432,11 +432,11 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a
void QMenuBarPrivate::QSymbianMenuBarPrivate::insertNativeMenuItems(const QList<QAction*> &actions)
{
for (int i = 0; i <actions.size(); ++i) {
- QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction;
+ QScopedPointer<QSymbianMenuAction> symbianActionTopLevel(new QSymbianMenuAction);
symbianActionTopLevel->action = actions.at(i);
symbianActionTopLevel->parent = 0;
symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++;
- qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus);
+ qt_symbian_insert_action(symbianActionTopLevel.data(), &symbianMenus);
}
}