From 44e5c01e35fa0d41868e99b0d5656c75e1e42557 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 1 Dec 2016 08:23:11 +0100 Subject: FULLPIPE: Fix crash on scene switch --- engines/fullpipe/motion.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 6edbd7bc94..05f13d4a8b 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -779,6 +779,9 @@ MovGraphItem::MovGraphItem() { } void MovGraphItem::free() { + if (!mi_movitems) + return; + for (uint i = 0; i < mi_movitems->size(); i++) { (*mi_movitems)[i]->movarr->_movSteps.clear(); delete (*mi_movitems)[i]->movarr; @@ -914,6 +917,7 @@ Common::Array *MovGraph::getPaths(StaticANIObject *ani, int x, int y, Common::Array *movitems = getPaths(&_items[idx]->movarr, (*movarr)[i], &sz); if (sz > 0) { + _items[idx]->mi_movitems = new Common::Array; for (int j = 0; j < sz; j++) _items[idx]->mi_movitems->push_back(movitems[j]); } -- cgit v1.2.3