From 3eb82462e772832a902ba336b680e2a961339ee1 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Wed, 20 Sep 2017 19:01:51 +0200 Subject: ALL: Specify the DisposeAfterUse constructor argument for dynamic memory write streams --- audio/decoders/quicktime.cpp | 2 +- audio/midiparser_qt.cpp | 2 +- engines/agi/sound_midi.cpp | 2 +- engines/pegasus/ai/ai_area.cpp | 2 +- engines/scumm/saveload.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp index b8eccb664b..4b0d5e078f 100644 --- a/audio/decoders/quicktime.cpp +++ b/audio/decoders/quicktime.cpp @@ -344,7 +344,7 @@ bool QuickTimeAudioDecoder::QuickTimeAudioTrack::isOldDemuxing() const { AudioStream *QuickTimeAudioDecoder::QuickTimeAudioTrack::readAudioChunk(uint chunk) { AudioSampleDesc *entry = (AudioSampleDesc *)_parentTrack->sampleDescs[0]; - Common::MemoryWriteStreamDynamic *wStream = new Common::MemoryWriteStreamDynamic(); + Common::MemoryWriteStreamDynamic *wStream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::NO); _decoder->_fd->seek(_parentTrack->chunkOffsets[chunk]); diff --git a/audio/midiparser_qt.cpp b/audio/midiparser_qt.cpp index 3078be9186..8821dbfaa8 100644 --- a/audio/midiparser_qt.cpp +++ b/audio/midiparser_qt.cpp @@ -455,7 +455,7 @@ void MidiParser_QT::initCommon() { byte *MidiParser_QT::readWholeTrack(Common::QuickTimeParser::Track *track, uint32 &trackSize) { // This just goes through all chunks and appends them together - Common::MemoryWriteStreamDynamic output; + Common::MemoryWriteStreamDynamic output(DisposeAfterUse::NO); uint32 curSample = 0; // Read in the note request data first diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp index 6998df6862..97dcc0d98b 100644 --- a/engines/agi/sound_midi.cpp +++ b/engines/agi/sound_midi.cpp @@ -169,7 +169,7 @@ static uint32 convertSND2MIDI(byte *snddata, byte **data) { int n; double ll; - Common::MemoryWriteStreamDynamic st; + Common::MemoryWriteStreamDynamic st(DisposeAfterUse::NO); ll = log10(pow(2.0, 1.0 / 12.0)); diff --git a/engines/pegasus/ai/ai_area.cpp b/engines/pegasus/ai/ai_area.cpp index c078d5e80e..58698e6c77 100644 --- a/engines/pegasus/ai/ai_area.cpp +++ b/engines/pegasus/ai/ai_area.cpp @@ -78,7 +78,7 @@ void AIArea::saveAIState() { delete vm->_aiSaveStream; - Common::MemoryWriteStreamDynamic out; + Common::MemoryWriteStreamDynamic out(DisposeAfterUse::NO); writeAIRules(&out); vm->_aiSaveStream = new Common::MemoryReadStream(out.getData(), out.size(), DisposeAfterUse::YES); diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 0ab36d1a96..06d564648b 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -228,7 +228,7 @@ void ScummEngine_v4::prepareSavegame() { _savePreparedSavegame = NULL; // store headerless savegame in a compressed memory stream - memStream = new Common::MemoryWriteStreamDynamic(); + memStream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::NO); writeStream = Common::wrapCompressedWriteStream(memStream); if (saveState(writeStream, false)) { // we have to finalize the compression-stream first, otherwise the internal -- cgit v1.2.3