[Scummvm-git-logs] scummvm master -> c14b080196f1fa9245ac8f8975ae18be4f97873d

eriktorbjorn noreply at scummvm.org
Thu Jan 11 17:30:19 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c14b080196 SWORD2: Fix crash when quitting the game while paused (bug #14814)


Commit: c14b080196f1fa9245ac8f8975ae18be4f97873d
    https://github.com/scummvm/scummvm/commit/c14b080196f1fa9245ac8f8975ae18be4f97873d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-01-11T18:28:33+01:00

Commit Message:
SWORD2: Fix crash when quitting the game while paused (bug #14814)

If the game is paused when the engine is being destructed, unpause it
immediately. Otherwise, it will happen automatically later when the
engine is in a semi-destructed state, causing it to crash.

Changed paths:
    engines/sword2/sword2.cpp


diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index a5f2ca20a92..9bf7af5dabc 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -89,6 +89,11 @@ Sword2Engine::Sword2Engine(OSystem *syst, const ADGameDescription *gameDesc) : E
 }
 
 Sword2Engine::~Sword2Engine() {
+	// Unpause the game now, or it will be done automatically when the
+	// game engine is half-deleted, causing it to crash.
+	if (isPaused())
+		_gamePauseToken.clear();
+
 	//_debugger is deleted by Engine
 	delete _sound;
 	delete _fontRenderer;




More information about the Scummvm-git-logs mailing list