Mercurial > octave-nkf
changeset 16441:ee652dcc9ecc
history_doc_widget context menu memory leak fix (bug #38675)
* libgui/src/history-dockwidget.cc (history_dock_widget::ctxMenu): changed context menu creation from dynamic memory to stack created so that is is freed when function returns.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Sat, 06 Apr 2013 07:53:00 -0400 |
parents | aaf024ac8015 |
children | 302157614308 |
files | libgui/src/history-dockwidget.cc |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/history-dockwidget.cc Thu Apr 04 22:22:17 2013 -0400 +++ b/libgui/src/history-dockwidget.cc Sat Apr 06 07:53:00 2013 -0400 @@ -81,10 +81,10 @@ } void history_dock_widget::ctxMenu(const QPoint &xpos) { - QMenu *menu = new QMenu; - menu->addAction(tr("Copy"), this, SLOT(handle_contextmenu_copy(bool))); - menu->addAction(tr("Evaluate"), this, SLOT(handle_contextmenu_evaluate(bool))); - menu->exec(_history_list_view->mapToGlobal(xpos)); + QMenu menu(this); + menu.addAction(tr("Copy"), this, SLOT(handle_contextmenu_copy(bool))); + menu.addAction(tr("Evaluate"), this, SLOT(handle_contextmenu_evaluate(bool))); + menu.exec(_history_list_view->mapToGlobal(xpos)); } void history_dock_widget::handle_contextmenu_copy(bool)