OK, this is the last pointer change for Console; the d'tor is now empty.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3039 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-11-04 00:52:00 +00:00
parent a48c4fc6a8
commit 7e25d13b13
2 changed files with 3 additions and 6 deletions

View File

@ -70,7 +70,6 @@ Console::Console(OSystem& osystem, Cartridge* cart, const Properties& props)
: myOSystem(osystem),
myEvent(osystem.eventHandler().event()),
myProperties(props),
myCMHandler(nullptr),
myDisplayFormat(""), // Unknown TV format @ start
myFramerate(0.0), // Unknown framerate @ start
myCurrentFormat(0), // Unknown format @ start
@ -166,7 +165,6 @@ Console::Console(OSystem& osystem, Cartridge* cart, const Properties& props)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Console::~Console()
{
delete myCMHandler;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -589,14 +587,13 @@ void Console::setControllers(const string& rommd5)
// creates them for us, and also that they must be used in both ports
if(left == "COMPUMATE" || right == "COMPUMATE")
{
delete myCMHandler;
myCMHandler = new CompuMate(*this, myEvent, *mySystem);
myCMHandler = make_shared<CompuMate>(*this, myEvent, *mySystem);
// A somewhat ugly bit of code that casts to CartridgeCM to
// add the CompuMate, and then back again for the actual
// Cartridge
unique_ptr<CartridgeCM> cartcm(static_cast<CartridgeCM*>(myCart.release()));
cartcm->setCompuMate(myCMHandler);
cartcm->setCompuMate(myCMHandler.get());
myCart = std::move(cartcm);
myLeftControl = unique_ptr<Controller>(myCMHandler->leftController());

View File

@ -349,7 +349,7 @@ class Console : public Serializable
unique_ptr<Controller> myLeftControl, myRightControl;
// Pointer to CompuMate handler (only used in CompuMate ROMs)
CompuMate* myCMHandler;
shared_ptr<CompuMate> myCMHandler;
// The currently defined display format (NTSC/PAL/SECAM)
string myDisplayFormat;