mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 18:31:37 +00:00
SUPERNOVA: Fixes segfault if dat file not found
This commit is contained in:
parent
c0f47712c2
commit
e40a017962
@ -121,6 +121,8 @@ SupernovaEngine::SupernovaEngine(OSystem *syst)
|
||||
DebugMan.addDebugChannel(kDebugGeneral, "general", "Supernova general debug channel");
|
||||
|
||||
_rnd = new Common::RandomSource("supernova");
|
||||
_soundMusic[0] = NULL;
|
||||
_soundMusic[1] = NULL;
|
||||
}
|
||||
|
||||
SupernovaEngine::~SupernovaEngine() {
|
||||
@ -130,9 +132,6 @@ SupernovaEngine::~SupernovaEngine() {
|
||||
delete _rnd;
|
||||
delete _console;
|
||||
delete _gm;
|
||||
for (int i = 0; i < kAudioNumSamples; ++i) {
|
||||
delete[] _soundSamples[i]._buffer;
|
||||
}
|
||||
delete _soundMusic[0];
|
||||
delete _soundMusic[1];
|
||||
}
|
||||
|
@ -76,6 +76,20 @@ private:
|
||||
ScreenBuffer *_last;
|
||||
};
|
||||
|
||||
struct SoundSample {
|
||||
SoundSample()
|
||||
: _buffer(NULL)
|
||||
, _length(0)
|
||||
{}
|
||||
|
||||
~SoundSample() {
|
||||
delete _buffer;
|
||||
}
|
||||
|
||||
byte *_buffer;
|
||||
int _length;
|
||||
};
|
||||
|
||||
class SupernovaEngine : public Engine {
|
||||
public:
|
||||
explicit SupernovaEngine(OSystem *syst);
|
||||
@ -91,10 +105,7 @@ public:
|
||||
byte _mouseNormal[256];
|
||||
byte _mouseWait[256];
|
||||
MSNImageDecoder *_currentImage;
|
||||
struct SoundSample {
|
||||
byte *_buffer;
|
||||
int _length;
|
||||
} _soundSamples[kAudioNumSamples];
|
||||
SoundSample _soundSamples[kAudioNumSamples];
|
||||
Common::MemoryReadStream *_soundMusic[2];
|
||||
Common::Event _event;
|
||||
int _screenWidth;
|
||||
|
Loading…
Reference in New Issue
Block a user