From 5d927915ab097020d486e61305f37c186fe7a9a0 Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 9 Nov 2014 13:41:55 +0000 Subject: [PATCH] A few more unique_ptr instances which I missed. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3061 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/debugger/gui/DebuggerDialog.cxx | 6 ++---- src/debugger/gui/DebuggerDialog.hxx | 2 +- src/gui/LauncherDialog.cxx | 6 +++--- src/gui/LauncherDialog.hxx | 2 +- src/gui/RomAuditDialog.cxx | 7 +++---- src/gui/RomAuditDialog.hxx | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 8e250b2ab..82b4b5021 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -262,10 +262,8 @@ void DebuggerDialog::createFont() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DebuggerDialog::showFatalMessage(const string& msg) { - delete myFatalError; - myFatalError = - new GUI::MessageBox(this, *myLFont, msg, _w/2, _h/2, kDDExitFatalCmd, - "Exit ROM", "Continue"); + myFatalError = make_ptr(this, *myLFont, msg, _w/2, _h/2, + kDDExitFatalCmd, "Exit ROM", "Continue"); myFatalError->show(); } diff --git a/src/debugger/gui/DebuggerDialog.hxx b/src/debugger/gui/DebuggerDialog.hxx index f4d0f93f9..543641f62 100644 --- a/src/debugger/gui/DebuggerDialog.hxx +++ b/src/debugger/gui/DebuggerDialog.hxx @@ -115,7 +115,7 @@ class DebuggerDialog : public Dialog CartRamWidget* myCartRam; EditTextWidget* myMessageBox; ButtonWidget* myRewindButton; - GUI::MessageBox* myFatalError; + unique_ptr myFatalError; unique_ptr myLFont; // used for labels unique_ptr myNFont; // used for normal text diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 55ef23073..5a2d9c5d3 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -54,7 +54,6 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, myQuitButton(nullptr), myList(nullptr), myRomInfoWidget(nullptr), - myFirstRunMsg(nullptr), mySelectedItem(0) { const GUI::Font& font = instance().frameBuffer().launcherFont(); @@ -235,8 +234,9 @@ void LauncherDialog::loadConfig() msg.push_back(""); msg.push_back("Click 'OK' to select a default ROM directory,"); msg.push_back("or 'Cancel' to browse the filesystem manually."); - myFirstRunMsg = new GUI::MessageBox(this, instance().frameBuffer().font(), - msg, _w, _h, kFirstRunMsgChosenCmd); + myFirstRunMsg = make_ptr + (this, instance().frameBuffer().font(), + msg, _w, _h, kFirstRunMsgChosenCmd); } myFirstRunMsg->show(); } diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index 12c2598c8..faef97e7f 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -100,6 +100,7 @@ class LauncherDialog : public Dialog unique_ptr myGlobalProps; unique_ptr myFilters; unique_ptr myRomDir; + unique_ptr myFirstRunMsg; ButtonWidget* myStartButton; ButtonWidget* myPrevDirButton; @@ -113,7 +114,6 @@ class LauncherDialog : public Dialog EditTextWidget* myPattern; RomInfoWidget* myRomInfoWidget; - GUI::MessageBox* myFirstRunMsg; int mySelectedItem; FilesystemNode myCurrentNode; diff --git a/src/gui/RomAuditDialog.cxx b/src/gui/RomAuditDialog.cxx index 70470fbb6..a10d2beeb 100644 --- a/src/gui/RomAuditDialog.cxx +++ b/src/gui/RomAuditDialog.cxx @@ -184,10 +184,9 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd, msg.push_back(""); msg.push_back("If you're sure you want to proceed with the"); msg.push_back("audit, click 'OK', otherwise click 'Cancel'."); - myConfirmMsg = - new GUI::MessageBox(this, instance().frameBuffer().font(), msg, - myMaxWidth, myMaxHeight, - kConfirmAuditCmd); + myConfirmMsg = make_ptr + (this, instance().frameBuffer().font(), msg, + myMaxWidth, myMaxHeight, kConfirmAuditCmd); } myConfirmMsg->show(); break; diff --git a/src/gui/RomAuditDialog.hxx b/src/gui/RomAuditDialog.hxx index aee170c8d..ab9d92128 100644 --- a/src/gui/RomAuditDialog.hxx +++ b/src/gui/RomAuditDialog.hxx @@ -65,7 +65,7 @@ class RomAuditDialog : public Dialog StaticTextWidget* myResults2; // Show a message about the dangers of using this function - GUI::MessageBox* myConfirmMsg; + unique_ptr myConfirmMsg; // Maximum width and height for this dialog int myMaxWidth, myMaxHeight;