DolphinQt: Fix memory leaks in MemoryWidget
QMenuBar::addMenu does not take ownership of the QMenu, setting their parent allows them to be cleaned up
This commit is contained in:
parent
7dde0c3c31
commit
f424e7815a
|
@ -249,12 +249,12 @@ void MemoryWidget::CreateWidgets()
|
|||
QMenuBar* menubar = new QMenuBar(sidebar);
|
||||
menubar->setNativeMenuBar(false);
|
||||
|
||||
QMenu* menu_import = new QMenu(tr("&Import"));
|
||||
QMenu* menu_import = new QMenu(tr("&Import"), menubar);
|
||||
menu_import->addAction(tr("&Load file to current address"), this,
|
||||
&MemoryWidget::OnSetValueFromFile);
|
||||
menubar->addMenu(menu_import);
|
||||
|
||||
QMenu* menu_export = new QMenu(tr("&Export"));
|
||||
QMenu* menu_export = new QMenu(tr("&Export"), menubar);
|
||||
menu_export->addAction(tr("Dump &MRAM"), this, &MemoryWidget::OnDumpMRAM);
|
||||
menu_export->addAction(tr("Dump &ExRAM"), this, &MemoryWidget::OnDumpExRAM);
|
||||
menu_export->addAction(tr("Dump &ARAM"), this, &MemoryWidget::OnDumpARAM);
|
||||
|
|
Loading…
Reference in New Issue