aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/composer/composer.h1
-rw-r--r--engines/composer/graphics.cpp6
-rw-r--r--engines/composer/resource.cpp1
3 files changed, 7 insertions, 1 deletions
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index cebe977517..0f53258289 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -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;
diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp
index 42d0a20d5a..1314e903ae 100644
--- a/engines/composer/graphics.cpp
+++ b/engines/composer/graphics.cpp
@@ -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) {
diff --git a/engines/composer/resource.cpp b/engines/composer/resource.cpp
index 6d7f2f2979..a4e292747c 100644
--- a/engines/composer/resource.cpp
+++ b/engines/composer/resource.cpp
@@ -255,7 +255,6 @@ Pipe::Pipe(Common::SeekableReadStream *stream) {
}
Pipe::~Pipe() {
- delete _stream;
}
void Pipe::nextFrame() {