[Scummvm-git-logs] scummvm master -> 59ac590df23552ac02cb90986c2e1ad71afa6e15
antoniou79
noreply at scummvm.org
Fri Aug 25 10:04:01 UTC 2023
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:
59ac590df2 PINK: Don't use references to Strings in initModule
Commit: 59ac590df23552ac02cb90986c2e1ad71afa6e15
https://github.com/scummvm/scummvm/commit/59ac590df23552ac02cb90986c2e1ad71afa6e15
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-08-25T13:01:00+03:00
Commit Message:
PINK: Don't use references to Strings in initModule
initModule calls removeModule() which results to wiping out the current _module object
This would previously result to String references no longer refering to valid Strings. This should fix the issue with segmentation fault
during the game intro when selecting New Game (and the glitch of replaying that intro video on top of itself).
Changed paths:
engines/pink/pink.cpp
engines/pink/pink.h
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 6d75b4eb61c..132a1fbd4f5 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -183,7 +183,7 @@ void PinkEngine::load(Archive &archive) {
_modules.deserialize(archive);
}
-void PinkEngine::initModule(const Common::String &moduleName, const Common::String &pageName, Archive *saveFile) {
+void PinkEngine::initModule(const Common::String moduleName, const Common::String pageName, Archive *saveFile) {
if (_module)
removeModule();
@@ -230,7 +230,7 @@ void PinkEngine::removeModule() {
for (uint i = 0; i < _modules.size(); ++i) {
if (_module == _modules[i]) {
_pdaMgr.close();
- _modules[i] = new ModuleProxy(_module->getName());
+ _modules[i] = new ModuleProxy(Common::String(_module->getName()));
delete _module;
_module = nullptr;
break;
diff --git a/engines/pink/pink.h b/engines/pink/pink.h
index d9b0e0a5ef8..734aee5b63a 100644
--- a/engines/pink/pink.h
+++ b/engines/pink/pink.h
@@ -147,7 +147,7 @@ private:
bool loadCursors();
- void initModule(const Common::String &moduleName, const Common::String &pageName, Archive *saveFile);
+ void initModule(const Common::String moduleName, const Common::String pageName, Archive *saveFile);
void addModule(const Common::String &moduleName);
void removeModule();
More information about the Scummvm-git-logs
mailing list