From 2ab906bafd7e154bb9e333d7e76fe2a714478efd Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Thu, 8 Oct 2009 21:00:21 +0000 Subject: SCI/newgui: RestoreBits() now ignores empty handles svn-id: r44801 --- engines/sci/gui/gui_gfx.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index d4fc056308..056bbecdc8 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -606,11 +606,15 @@ GuiMemoryHandle SciGuiGfx::SaveBits(const Common::Rect &rect, byte screenMask) { } void SciGuiGfx::RestoreBits(GuiMemoryHandle memoryHandle) { - byte *memoryPtr = kmem(_s->_segMan, memoryHandle);; + byte *memoryPtr = NULL; - if (memoryPtr) { - _screen->restoreBits(memoryPtr); - kfree(_s->_segMan, memoryHandle); + if (!memoryHandle.isNull()) { + memoryPtr = kmem(_s->_segMan, memoryHandle);; + + if (memoryPtr) { + _screen->restoreBits(memoryPtr); + kfree(_s->_segMan, memoryHandle); + } } } -- cgit v1.2.3