[Scummvm-cvs-logs] scummvm master -> 278a14d96ef40acabaf038f70662be671d9093fc

eriktorbjorn eriktorbjorn at telia.com
Thu Aug 7 23:02:44 CEST 2014


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

Summary:
42c9b1a2c1 COMMON: Minor whitespace fix.
278a14d96e COMMON: Fix crash when quitting on "Game data not found" dialog


Commit: 42c9b1a2c18a5741bd5eeeaa3d33ca6f65ac235d
    https://github.com/scummvm/scummvm/commit/42c9b1a2c18a5741bd5eeeaa3d33ca6f65ac235d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-08-07T22:46:24+02:00

Commit Message:
COMMON: Minor whitespace fix.

Changed paths:
    common/config-manager.cpp



diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index feb3ddc..a34e32c 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -597,7 +597,7 @@ void ConfigManager::setActiveDomain(const String &domName) {
 		_activeDomain = 0;
 	} else {
 		assert(isValidDomainName(domName));
-		_activeDomain = & _gameDomains[domName];
+		_activeDomain = &_gameDomains[domName];
 	}
 	_activeDomainName = domName;
 }


Commit: 278a14d96ef40acabaf038f70662be671d9093fc
    https://github.com/scummvm/scummvm/commit/278a14d96ef40acabaf038f70662be671d9093fc
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-08-07T22:55:52+02:00

Commit Message:
COMMON: Fix crash when quitting on "Game data not found" dialog

ScummVM would try to look up "confirm_exit" in the active domain,
even though the active domain had been removed and pointed to an
invalid address. To avoid this, try to keep _activeDomain and
_activeDomainName updated if removeGameDomain() removes the active
domain.

For good measure, also do it if the active domain is removed by
renameGameDomain(), though I don't know if there was any case where
this would have caused trouble.

Changed paths:
    common/config-manager.cpp



diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index a34e32c..04b6237 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -626,6 +626,10 @@ void ConfigManager::addMiscDomain(const String &domName) {
 void ConfigManager::removeGameDomain(const String &domName) {
 	assert(!domName.empty());
 	assert(isValidDomainName(domName));
+	if (domName == _activeDomainName) {
+		_activeDomainName = "";
+		_activeDomain = 0;
+	}
 	_gameDomains.erase(domName);
 }
 
@@ -638,6 +642,10 @@ void ConfigManager::removeMiscDomain(const String &domName) {
 
 void ConfigManager::renameGameDomain(const String &oldName, const String &newName) {
 	renameDomain(oldName, newName, _gameDomains);
+	if (_activeDomainName == oldName) {
+		_activeDomainName = newName;
+		_activeDomain = &_gameDomains[newName];
+	}
 }
 
 void ConfigManager::renameMiscDomain(const String &oldName, const String &newName) {






More information about the Scummvm-git-logs mailing list