From f46fa18006755f7ec8e351f095b7b21a497aa6a4 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sat, 30 Sep 2017 11:20:53 -0500 Subject: SCI32: Stop trying to clean up uninitialized VMDs Fixes Trac#10252. --- engines/sci/graphics/video32.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 736ee15428..e837cecb49 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -599,20 +599,26 @@ VMDPlayer::IOStatus VMDPlayer::close() { return kIOSuccess; } - if (_isComposited) { - closeComposited(); - } else { - closeOverlay(); - } + if (_isInitialized) { + if (_isComposited) { + closeComposited(); + } else { + closeOverlay(); + } - if (_blackoutPlane != nullptr) { - g_sci->_gfxFrameout->deletePlane(*_blackoutPlane); - _blackoutPlane = nullptr; - } + if (_blackoutPlane != nullptr) { + g_sci->_gfxFrameout->deletePlane(*_blackoutPlane); + _blackoutPlane = nullptr; + } - if (!_leaveLastFrame && !_leaveScreenBlack) { - // This call *actually* deletes the blackout plane - g_sci->_gfxFrameout->frameOut(true); + if (!_leaveLastFrame && !_leaveScreenBlack) { + // This call *actually* deletes the blackout plane + g_sci->_gfxFrameout->frameOut(true); + } + + if (!_showCursor) { + g_sci->_gfxCursor32->unhide(); + } } _decoder->close(); @@ -622,10 +628,6 @@ VMDPlayer::IOStatus VMDPlayer::close() { _bundledVmd = nullptr; } - if (!_showCursor) { - g_sci->_gfxCursor32->unhide(); - } - _isOpen = false; _isInitialized = false; _ignorePalettes = false; -- cgit v1.2.3