aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlyssa Milburn2011-11-05 18:33:52 +0100
committerAlyssa Milburn2011-11-05 18:33:52 +0100
commit5e2ab1d05073058628dabd2826f60b72154da8b4 (patch)
tree23f300907eaa3c94fbebe0d6291011229bb4d15b /engines
parent21fa7bda57c2656db5abd68fdabe0bcd5f292e18 (diff)
downloadscummvm-rg350-5e2ab1d05073058628dabd2826f60b72154da8b4.tar.gz
scummvm-rg350-5e2ab1d05073058628dabd2826f60b72154da8b4.tar.bz2
scummvm-rg350-5e2ab1d05073058628dabd2826f60b72154da8b4.zip
COMPOSER: Don't delete pipe streams too early.
Diffstat (limited to 'engines')
-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() {