[Scummvm-git-logs] scummvm master -> 8ccb56477202e8c8c4502ca7947205df42837844

bgK bastien.bouclet at gmail.com
Mon Jun 22 19:14:24 UTC 2020


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:
8ccb564772 3DS: Fix crash when quitting with the home button when a game is started


Commit: 8ccb56477202e8c8c4502ca7947205df42837844
    https://github.com/scummvm/scummvm/commit/8ccb56477202e8c8c4502ca7947205df42837844
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2020-06-22T21:10:41+02:00

Commit Message:
3DS: Fix crash when quitting with the home button when a game is started

Fixes #11512.

Changed paths:
    backends/platform/3ds/osystem-events.cpp
    engines/engine.h


diff --git a/backends/platform/3ds/osystem-events.cpp b/backends/platform/3ds/osystem-events.cpp
index 627cba4dbd..a42898fa4a 100644
--- a/backends/platform/3ds/osystem-events.cpp
+++ b/backends/platform/3ds/osystem-events.cpp
@@ -224,12 +224,19 @@ static void aptHookFunc(APT_HookType hookType, void *param) {
 			osys->sleeping = false;
 			loadConfig();
 			break;
-		default: {
+		case APTHOOK_ONEXIT: {
+			if (osys->_sleepPauseToken.isActive()) {
+				osys->_sleepPauseToken.clear();
+			}
+
 			Common::StackLock lock(*eventMutex);
 			Common::Event event;
 			event.type = Common::EVENT_QUIT;
 			g_system->getEventManager()->pushEvent(event);
+			break;
 		}
+		default:
+			warning("Unhandled APT hook, type: %d", hookType);
 	}
 }
 
diff --git a/engines/engine.h b/engines/engine.h
index 5de9b076e1..e7cf444d88 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -80,6 +80,13 @@ public:
 	* currently represents a pause request.
 	*/
 	void clear();
+
+	/**
+	 * Returns true if the PauseToken represents a pause level,
+	 * false if it is empty.
+	 */
+	bool isActive() const { return _engine != nullptr; }
+
 private:
 	PauseToken(Engine *);
 




More information about the Scummvm-git-logs mailing list