SCI/newgui: RestoreBits() now ignores empty handles

svn-id: r44801
This commit is contained in:
Martin Kiewitz 2009-10-08 21:00:21 +00:00
parent cc236d9799
commit 2ab906bafd

View File

@ -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);
}
}
}