From eadbe2b8b87777ab92234264a4be990be74f03ad Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 7 Aug 2015 16:02:19 -0400 Subject: SHERLOCK: RT: Fix crash executing scripts that clear their own data --- engines/sherlock/talk.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index b347bd458d..83596e4e85 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -339,7 +339,8 @@ void Talk::talkTo(const Common::String &filename) { _scriptSelect = select; _speaker = _talkTo; - Statement &statement = _statements[select]; + // Make a copy of the statement (in case the script frees the statement list), and then execute it + Statement statement = _statements[select]; doScript(_statements[select]._reply); if (IS_ROSE_TATTOO) { -- cgit v1.2.3