From 6a1c315fdf60f700b3f49f62a714baf7b2b8ea08 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 13 Oct 2004 06:36:29 +0000 Subject: Don't let undraw_mouse() terminate with the surface still locked. Now I can finally quit Broken Sword II again, without ScummVM crashing. svn-id: r15536 --- backends/sdl/graphics.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'backends/sdl') diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index af817ddd78..f074f0e34d 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -1013,9 +1013,6 @@ void OSystem_SDL::undraw_mouse() { return; _mouseDrawn = false; - if (SDL_LockSurface(_overlayVisible ? _tmpscreen : _screen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - int old_mouse_x = _mouseCurState.x - _mouseHotspotX; int old_mouse_y = _mouseCurState.y - _mouseHotspotY; int old_mouse_w = _mouseCurState.w; @@ -1040,6 +1037,8 @@ void OSystem_SDL::undraw_mouse() { if (old_mouse_w <= 0 || old_mouse_h <= 0) return; + if (SDL_LockSurface(_overlayVisible ? _tmpscreen : _screen) == -1) + error("SDL_LockSurface failed: %s", SDL_GetError()); int x, y; if (!_overlayVisible) { -- cgit v1.2.3