Due to some changes I made today, stella-sound would no longer quit when you

exited the emulator.  This is now fixed.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@60 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2002-03-28 23:11:21 +00:00
parent 47ed9dffc1
commit 46f5aaafd9
2 changed files with 16 additions and 6 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: mainSDL.cxx,v 1.17 2002-03-28 18:20:35 stephena Exp $ // $Id: mainSDL.cxx,v 1.18 2002-03-28 23:11:20 stephena Exp $
//============================================================================ //============================================================================
#include <fstream> #include <fstream>
@ -1305,8 +1305,6 @@ void cleanup()
SDL_Quit(); SDL_Quit();
} }
exit(0);
} }
@ -1319,6 +1317,7 @@ int main(int argc, char* argv[])
{ {
cerr << "ERROR: Couldn't create settings." << endl; cerr << "ERROR: Couldn't create settings." << endl;
cleanup(); cleanup();
return 0;
} }
// Load in any user defined settings from an RC file // Load in any user defined settings from an RC file
@ -1329,6 +1328,7 @@ int main(int argc, char* argv[])
{ {
usage(); usage();
cleanup(); cleanup();
return 0;
} }
// Get a pointer to the file which contains the cartridge ROM // Get a pointer to the file which contains the cartridge ROM
@ -1340,6 +1340,7 @@ int main(int argc, char* argv[])
{ {
cerr << "ERROR: Couldn't open " << file << "..." << endl; cerr << "ERROR: Couldn't open " << file << "..." << endl;
cleanup(); cleanup();
return 0;
} }
uInt8* image = new uInt8[512 * 1024]; uInt8* image = new uInt8[512 * 1024];
@ -1353,6 +1354,7 @@ int main(int argc, char* argv[])
{ {
delete[] image; delete[] image;
cleanup(); cleanup();
return 0;
} }
// Create a sound object for use with the console // Create a sound object for use with the console
@ -1373,11 +1375,13 @@ int main(int argc, char* argv[])
{ {
cerr << "ERROR: Couldn't set up display.\n"; cerr << "ERROR: Couldn't set up display.\n";
cleanup(); cleanup();
return 0;
} }
if(!setupJoystick()) if(!setupJoystick())
{ {
cerr << "ERROR: Couldn't set up joysticks.\n"; cerr << "ERROR: Couldn't set up joysticks.\n";
cleanup(); cleanup();
return 0;
} }
#ifdef EXPERIMENTAL_TIMING #ifdef EXPERIMENTAL_TIMING
@ -1484,6 +1488,7 @@ int main(int argc, char* argv[])
// Cleanup time ... // Cleanup time ...
cleanup(); cleanup();
return 0;
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: mainX11.cxx,v 1.18 2002-03-28 18:20:35 stephena Exp $ // $Id: mainX11.cxx,v 1.19 2002-03-28 23:11:21 stephena Exp $
//============================================================================ //============================================================================
#include <fstream> #include <fstream>
@ -1205,8 +1205,6 @@ void cleanup()
if(theRightJoystickFd) if(theRightJoystickFd)
close(theRightJoystickFd); close(theRightJoystickFd);
#endif #endif
exit(0);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -1218,6 +1216,7 @@ int main(int argc, char* argv[])
{ {
cerr << "ERROR: Couldn't create settings." << endl; cerr << "ERROR: Couldn't create settings." << endl;
cleanup(); cleanup();
return 0;
} }
// Load in any user defined settings from an RC file // Load in any user defined settings from an RC file
@ -1228,6 +1227,7 @@ int main(int argc, char* argv[])
{ {
usage(); usage();
cleanup(); cleanup();
return 0;
} }
// Get a pointer to the file which contains the cartridge ROM // Get a pointer to the file which contains the cartridge ROM
@ -1239,6 +1239,7 @@ int main(int argc, char* argv[])
{ {
cerr << "ERROR: Couldn't open " << file << "..." << endl; cerr << "ERROR: Couldn't open " << file << "..." << endl;
cleanup(); cleanup();
return 0;
} }
uInt8* image = new uInt8[512 * 1024]; uInt8* image = new uInt8[512 * 1024];
@ -1252,6 +1253,7 @@ int main(int argc, char* argv[])
{ {
delete[] image; delete[] image;
cleanup(); cleanup();
return 0;
} }
// Create a sound object for use with the console // Create a sound object for use with the console
@ -1272,11 +1274,13 @@ int main(int argc, char* argv[])
{ {
cerr << "ERROR: Couldn't set up display.\n"; cerr << "ERROR: Couldn't set up display.\n";
cleanup(); cleanup();
return 0;
} }
if(!setupJoystick()) if(!setupJoystick())
{ {
cerr << "ERROR: Couldn't set up joysticks.\n"; cerr << "ERROR: Couldn't set up joysticks.\n";
cleanup(); cleanup();
return 0;
} }
#ifdef EXPERIMENTAL_TIMING #ifdef EXPERIMENTAL_TIMING
@ -1383,6 +1387,7 @@ int main(int argc, char* argv[])
// Cleanup time ... // Cleanup time ...
cleanup(); cleanup();
return 0;
} }
/** /**