[Scummvm-git-logs] scummvm master -> 536bc29e547c7a5c62eb5fec8201067912dc6e15
sev-
sev at scummvm.org
Fri Jan 13 19:09:41 CET 2017
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:
536bc29e54 DIRECTOR: Lingo: Improved localvars cleanup
Commit: 536bc29e547c7a5c62eb5fec8201067912dc6e15
https://github.com/scummvm/scummvm/commit/536bc29e547c7a5c62eb5fec8201067912dc6e15
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-01-13T19:10:35+01:00
Commit Message:
DIRECTOR: Lingo: Improved localvars cleanup
Changed paths:
engines/director/lingo/lingo-codegen.cpp
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index b30bf03..da5c8de 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -192,11 +192,19 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) {
void Lingo::cleanLocalVars() {
// Clean up current scope local variables and clean up memory
+ debugC(3, kDebugLingoExec, "cleanLocalVars: have %d vars", _localvars->size());
+
for (SymbolHash::const_iterator h = _localvars->begin(); h != _localvars->end(); ++h) {
- if (!h->_value->global)
- delete h->_value;
+ if (!h->_value->global) {
+ Symbol *sym = h->_value;
+ free(sym->name);
+ delete sym;
+ }
}
+
delete g_lingo->_localvars;
+
+ g_lingo->_localvars = 0;
}
void Lingo::define(Common::String &name, int start, int nargs, Common::String *prefix, int end) {
More information about the Scummvm-git-logs
mailing list