diff options
author | Janne Anttila <janne.anttila@digia.com> | 2010-09-20 13:23:15 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-09-21 05:12:00 (GMT) |
commit | 4b818b1d2e87dd09d3c267e8c486793033b2e1b1 (patch) | |
tree | e513429cd23910c4d49e546509fb3df7264fee82 /src/gui/widgets | |
parent | f32fa315dd417384db63b11e908c7b10de10ef46 (diff) | |
download | Qt-4b818b1d2e87dd09d3c267e8c486793033b2e1b1.zip Qt-4b818b1d2e87dd09d3c267e8c486793033b2e1b1.tar.gz Qt-4b818b1d2e87dd09d3c267e8c486793033b2e1b1.tar.bz2 |
Fixed memory leak in Symbian when Options menu was launched.
Task-number: QTBUG-13437
Reviewed-by: Janne Koskinen
(cherry picked from commit 0cbb1a488c4199ad06b8ab63a9d6bf09fc8a6911)
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmenu_symbian.cpp | 8 |
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); } } |