DolphinQt: Properly Delete (Some) Widgets

This is not every memory leak, just the ones that were obvious.
This commit is contained in:
mitaclaw
2024-04-30 10:58:16 -07:00
parent e69486d2cb
commit 0397339ab1
12 changed files with 25 additions and 9 deletions

View File

@ -309,6 +309,7 @@ void BreakpointWidget::OnClear()
void BreakpointWidget::OnNewBreakpoint()
{
BreakpointDialog* dialog = new BreakpointDialog(this);
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
SetQWidgetWindowDecorations(dialog);
dialog->exec();
}
@ -319,6 +320,7 @@ void BreakpointWidget::OnEditBreakpoint(u32 address, bool is_instruction_bp)
{
auto* dialog =
new BreakpointDialog(this, m_system.GetPowerPC().GetBreakPoints().GetBreakpoint(address));
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
SetQWidgetWindowDecorations(dialog);
dialog->exec();
}
@ -326,6 +328,7 @@ void BreakpointWidget::OnEditBreakpoint(u32 address, bool is_instruction_bp)
{
auto* dialog =
new BreakpointDialog(this, m_system.GetPowerPC().GetMemChecks().GetMemCheck(address));
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
SetQWidgetWindowDecorations(dialog);
dialog->exec();
}
@ -387,6 +390,7 @@ void BreakpointWidget::OnContextMenu()
const auto is_memory_breakpoint = selected_item->data(IS_MEMCHECK_ROLE).toBool();
auto* menu = new QMenu(this);
menu->setAttribute(Qt::WA_DeleteOnClose, true);
if (!is_memory_breakpoint)
{