Skip to content

Commit 01a7119

Browse files
committed
Fixed memory leak
1 parent 631c038 commit 01a7119

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Managers/LuaMan.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@ namespace RTE {
723723
}
724724

725725
auto& newScript = m_ScriptCache[funcObjectName.c_str()];
726+
for (auto& pair : newScript.functionNamesAndObjects) {
727+
delete pair.second;
728+
}
726729
newScript.functionNamesAndObjects.clear();
727730
for (const std::string& functionName : functionNamesToLookFor) {
728731
luabind::object functionObject = funcHoldingObject[functionName];

0 commit comments

Comments
 (0)