mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 06:41:51 +00:00
COMPOSER: Don't delete pipe streams too early.
This commit is contained in:
parent
21fa7bda57
commit
5e2ab1d050
@ -186,6 +186,7 @@ private:
|
||||
Common::Array<QueuedScript> _queuedScripts;
|
||||
Common::List<Animation *> _anims;
|
||||
Common::List<Pipe *> _pipes;
|
||||
Common::Array<Common::SeekableReadStream *> _pipeStreams;
|
||||
|
||||
Common::HashMap<uint16, Common::Array<RandomEvent> > _randomEvents;
|
||||
|
||||
|
@ -123,6 +123,7 @@ void ComposerEngine::playAnimation(uint16 animId, int16 x, int16 y, int16 eventP
|
||||
// If the resource is a pipe itself, then load the pipe
|
||||
// and then fish the requested animation out of it.
|
||||
if (type != 1) {
|
||||
_pipeStreams.push_back(stream);
|
||||
newPipe = new Pipe(stream);
|
||||
_pipes.push_front(newPipe);
|
||||
newPipe->nextFrame();
|
||||
@ -397,6 +398,11 @@ void ComposerEngine::stopPipes() {
|
||||
}
|
||||
|
||||
_pipes.clear();
|
||||
|
||||
// substreams may need to remain valid until the end of a page
|
||||
for (uint i = 0; i < _pipeStreams.size(); i++)
|
||||
delete _pipeStreams[i];
|
||||
_pipeStreams.clear();
|
||||
}
|
||||
|
||||
bool ComposerEngine::spriteVisible(uint16 id, uint16 animId) {
|
||||
|
@ -255,7 +255,6 @@ Pipe::Pipe(Common::SeekableReadStream *stream) {
|
||||
}
|
||||
|
||||
Pipe::~Pipe() {
|
||||
delete _stream;
|
||||
}
|
||||
|
||||
void Pipe::nextFrame() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user