aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMatthew Hoops2013-04-16 11:14:04 -0400
committerMatthew Hoops2013-04-16 11:14:04 -0400
commit8a50d8744570e7a426c76cd0ed00c5db671fd366 (patch)
treedf1b0face8c89eeccc16c87247e1f6fa955f0bd9 /engines/sci/engine
parent6c1b0190563666608aecb56daed4d192d3e31169 (diff)
downloadscummvm-rg350-8a50d8744570e7a426c76cd0ed00c5db671fd366.tar.gz
scummvm-rg350-8a50d8744570e7a426c76cd0ed00c5db671fd366.tar.bz2
scummvm-rg350-8a50d8744570e7a426c76cd0ed00c5db671fd366.zip
SCI: Fix potential memory leak with Mac cursor's hotspot
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kgraphics.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index a65bcc215e..e4b3028bcd 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -185,10 +185,12 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) {
hotspot = new Common::Point(argv[3].toSint16(), argv[4].toSint16());
// Fallthrough
case 3:
- if (g_sci->getPlatform() == Common::kPlatformMacintosh)
- g_sci->_gfxCursor->kernelSetMacCursor(argv[0].toUint16(), argv[1].toUint16(), argv[2].toUint16(), hotspot);
- else
+ if (g_sci->getPlatform() == Common::kPlatformMacintosh) {
+ delete hotspot; // Mac cursors have their own hotspot, so ignore any we get here
+ g_sci->_gfxCursor->kernelSetMacCursor(argv[0].toUint16(), argv[1].toUint16(), argv[2].toUint16());
+ } else {
g_sci->_gfxCursor->kernelSetView(argv[0].toUint16(), argv[1].toUint16(), argv[2].toUint16(), hotspot);
+ }
break;
case 10:
// Freddy pharkas, when using the whiskey glass to read the prescription (bug #3034973)