Fixed assorted leaks in NS Amiga.

svn-id: r34870
This commit is contained in:
Nicola Mettifogo 2008-11-01 12:39:01 +00:00
parent 92cfe5e246
commit cd3011e408
4 changed files with 10 additions and 2 deletions

View file

@ -903,7 +903,7 @@ Cnv* AmigaDisk_ns::makeCnv(Common::SeekableReadStream &stream) {
free(buf); free(buf);
return new Cnv(numFrames, width, height, data); return new Cnv(numFrames, width, height, data, true);
} }
#undef NUM_PLANES #undef NUM_PLANES

View file

@ -765,6 +765,7 @@ Gfx::Gfx(Parallaction* vm) :
_backgroundInfo = 0; _backgroundInfo = 0;
_halfbrite = false; _halfbrite = false;
_nextProjectorPos = 0;
_hbCircleRadius = 0; _hbCircleRadius = 0;
_unpackedBitmap = new byte[MAXIMUM_UNPACKED_BITMAP_SIZE]; _unpackedBitmap = new byte[MAXIMUM_UNPACKED_BITMAP_SIZE];

View file

@ -89,6 +89,7 @@ Parallaction::~Parallaction() {
delete _callableNames; delete _callableNames;
delete _cmdExec; delete _cmdExec;
delete _programExec; delete _programExec;
delete _saveLoad;
_gfx->clearGfxObjects(kGfxObjCharacter | kGfxObjNormal); _gfx->clearGfxObjects(kGfxObjCharacter | kGfxObjNormal);
hideDialogueStuff(); hideDialogueStuff();

View file

@ -312,9 +312,13 @@ void DosSoundMan::playLocationMusic(const char *location) {
AmigaSoundMan::AmigaSoundMan(Parallaction *vm) : SoundMan(vm) { AmigaSoundMan::AmigaSoundMan(Parallaction *vm) : SoundMan(vm) {
_musicStream = 0; _musicStream = 0;
_channels[0].data = 0; _channels[0].data = 0;
_channels[0].dispose = false;
_channels[1].data = 0; _channels[1].data = 0;
_channels[1].dispose = false;
_channels[2].data = 0; _channels[2].data = 0;
_channels[2].dispose = false;
_channels[3].data = 0; _channels[3].data = 0;
_channels[3].dispose = false;
} }
AmigaSoundMan::~AmigaSoundMan() { AmigaSoundMan::~AmigaSoundMan() {
@ -340,7 +344,7 @@ void AmigaSoundMan::loadChannelData(const char *filename, Channel *ch) {
ch->header.samplesPerHiCycle = 0; ch->header.samplesPerHiCycle = 0;
ch->header.samplesPerSec = 11934; ch->header.samplesPerSec = 11934;
ch->header.volume = 160; ch->header.volume = 160;
ch->data = new int8[AMIGABEEP_SIZE * NUM_REPEATS]; ch->data = (int8*)malloc(AMIGABEEP_SIZE * NUM_REPEATS);
int8* odata = ch->data; int8* odata = ch->data;
for (uint i = 0; i < NUM_REPEATS; i++) { for (uint i = 0; i < NUM_REPEATS; i++) {
memcpy(odata, res_amigaBeep, AMIGABEEP_SIZE); memcpy(odata, res_amigaBeep, AMIGABEEP_SIZE);
@ -364,6 +368,8 @@ void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, in
return; return;
} }
stopSfx(channel);
debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel); debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel);
Channel *ch = &_channels[channel]; Channel *ch = &_channels[channel];