Fixed crash when adding one-shot RAM based cheats.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1038 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-03-11 21:22:47 +00:00
parent ff639c7b4f
commit 7c644f92b8
3 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Cheat.hxx,v 1.3 2005-12-18 18:37:01 stephena Exp $
// $Id: Cheat.hxx,v 1.4 2006-03-11 21:22:47 stephena Exp $
//============================================================================
#ifndef CHEAT_HXX
@ -35,7 +35,7 @@ class Cheat
if(name == "") myName = code;
myName = StringList::removePattern(myName, "\":");
}
virtual ~Cheat() { }
virtual ~Cheat() { }
bool enabled() const { return myEnabled; }
const string& name() const { return myName; }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: CheatManager.cxx,v 1.8 2006-03-06 02:26:15 stephena Exp $
// $Id: CheatManager.cxx,v 1.9 2006-03-11 21:22:47 stephena Exp $
//============================================================================
#include <sstream>
@ -126,8 +126,8 @@ void CheatManager::addOneShot(const string& name, const string& code)
if(!cheat)
return;
// Enable this cheat once, and then immediately delete it
cheat->enable();
// Evaluate this cheat once, and then immediately delete it
cheat->evaluate();
delete cheat;
}

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: RamCheat.hxx,v 1.1 2005-11-11 21:44:18 stephena Exp $
// $Id: RamCheat.hxx,v 1.2 2006-03-11 21:22:47 stephena Exp $
//============================================================================
#ifndef RAM_CHEAT_HXX
@ -25,7 +25,7 @@ class RamCheat : public Cheat
{
public:
RamCheat(OSystem* os, const string& name, const string& code);
~RamCheat();
virtual ~RamCheat();
virtual bool enable();
virtual bool disable();