Fixed some uninitialized pointers that were causing segfaults at strange

times.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@414 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-05-08 17:38:23 +00:00
parent cf08dc29cd
commit 16ee1f8e7f
5 changed files with 16 additions and 29 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: EventHandler.cxx,v 1.53 2005-05-06 22:50:15 stephena Exp $
// $Id: EventHandler.cxx,v 1.54 2005-05-08 17:38:23 stephena Exp $
//============================================================================
#include <algorithm>
@ -591,17 +591,6 @@ void EventHandler::handleEvent(Event::Type event, Int32 state)
myOSystem->sound().mute(myPauseFlag);
return;
}
else if(event == Event::MenuMode)
{
// ExitGame will only work when we've launched stella using the ROM
// launcher. Otherwise, the only way to exit the main loop is to Quit.
if(myState == S_EMULATE && myUseLauncherFlag)
{
myOSystem->settings().saveConfig();
myOSystem->createLauncher();
return;
}
}
else if(event == Event::LauncherMode)
{
// ExitGame will only work when we've launched stella using the ROM

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: FrameBuffer.cxx,v 1.33 2005-05-06 22:50:15 stephena Exp $
// $Id: FrameBuffer.cxx,v 1.34 2005-05-08 17:38:23 stephena Exp $
//============================================================================
#include <sstream>
@ -38,8 +38,8 @@
FrameBuffer::FrameBuffer(OSystem* osystem)
: myOSystem(osystem),
theRedrawEntireFrameIndicator(true),
theZoomLevel(1),
theMaxZoomLevel(1),
theZoomLevel(2),
theMaxZoomLevel(2),
theAspectRatio(1.0),
theUseAspectRatioFlag(true),
myFrameRate(0),
@ -345,7 +345,7 @@ void FrameBuffer::resize(Size size, Int8 zoom)
return;
// Update the settings
myOSystem->settings().setInt("zoom", theZoomLevel);
// myOSystem->settings().setInt("zoom", theZoomLevel);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: FrameBuffer.hxx,v 1.29 2005-05-06 22:50:15 stephena Exp $
// $Id: FrameBuffer.hxx,v 1.30 2005-05-08 17:38:23 stephena Exp $
//============================================================================
#ifndef FRAMEBUFFER_HXX
@ -41,7 +41,7 @@ class OSystem;
All GUI elements (ala ScummVM) are drawn here as well.
@author Stephen Anthony
@version $Id: FrameBuffer.hxx,v 1.29 2005-05-06 22:50:15 stephena Exp $
@version $Id: FrameBuffer.hxx,v 1.30 2005-05-08 17:38:23 stephena Exp $
*/
class FrameBuffer
{
@ -135,7 +135,7 @@ class FrameBuffer
*/
void refresh(bool now = false)
{
// cerr << "refresh() " << myNumRedraws++ << endl;
//cerr << "refresh() " << myNumRedraws++ << endl;
theRedrawEntireFrameIndicator = true;
myMenuRedraws = 2;
if(now) drawMediaSource();

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: OSystem.cxx,v 1.12 2005-05-06 22:50:15 stephena Exp $
// $Id: OSystem.cxx,v 1.13 2005-05-08 17:38:23 stephena Exp $
//============================================================================
#include <cassert>
@ -120,11 +120,7 @@ bool OSystem::createFrameBuffer(bool showmessage)
}
// Delete the old framebuffer
if(myFrameBuffer)
{
delete myFrameBuffer;
myFrameBuffer = NULL;
}
delete myFrameBuffer; myFrameBuffer = NULL;
// And recreate a new one
string video = mySettings->getString("video");
@ -194,7 +190,7 @@ void OSystem::toggleFrameBuffer()
void OSystem::createSound()
{
// Delete the old sound device
delete mySound;
delete mySound; mySound = NULL;
// And recreate a new sound device
#ifdef SOUND_SUPPORT
@ -256,7 +252,7 @@ bool OSystem::createConsole(const string& romfile)
uInt32 size = in.gcount();
in.close();
delete myConsole;
delete myConsole; myConsole = NULL;
// Create an instance of the 2600 game console
// The Console c'tor takes care of updating the eventhandler state

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: LauncherDialog.cxx,v 1.2 2005-05-06 22:50:15 stephena Exp $
// $Id: LauncherDialog.cxx,v 1.3 2005-05-08 17:38:23 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -49,7 +49,9 @@ enum {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LauncherDialog::LauncherDialog(OSystem* osystem, uInt16 x, uInt16 y,
uInt16 w, uInt16 h)
: Dialog(osystem, x, y, w, h)
: Dialog(osystem, x, y, w, h),
myList(NULL),
myBrowser(NULL)
{
// Show game name
new StaticTextWidget(this, 10, 8, _w - 20, kLineHeight,