aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-08 21:00:21 +0000
committerMartin Kiewitz2009-10-08 21:00:21 +0000
commit2ab906bafd7e154bb9e333d7e76fe2a714478efd (patch)
treea5d0edbdfd1ce7e6be21be009f489d9f6fb9748b /engines/sci/gui
parentcc236d97990486bfe36a4f19fd01b139ea90d969 (diff)
downloadscummvm-rg350-2ab906bafd7e154bb9e333d7e76fe2a714478efd.tar.gz
scummvm-rg350-2ab906bafd7e154bb9e333d7e76fe2a714478efd.tar.bz2
scummvm-rg350-2ab906bafd7e154bb9e333d7e76fe2a714478efd.zip
SCI/newgui: RestoreBits() now ignores empty handles
svn-id: r44801
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui_gfx.cpp12
1 files 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);
+ }
}
}