File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -740,8 +740,10 @@ int LuaStateWrapper::RunScriptFileAndRetrieveFunctions(const std::string& filePa
740
740
auto cachedScript = m_ScriptCache.find (filePath);
741
741
if (!forceReload && cachedScript != m_ScriptCache.end ()) {
742
742
for (auto & pair: cachedScript->second .functionNamesAndObjects ) {
743
- luabind::object* functionObjectCopyForStoring = new luabind::object (*pair.second ->GetLuabindObject ());
744
- outFunctionNamesAndObjects.try_emplace (pair.first , new LuabindObjectWrapper (functionObjectCopyForStoring, filePath));
743
+ if (std::find (functionNamesToLookFor.begin (), functionNamesToLookFor.end (), pair.first ) != functionNamesToLookFor.end ()) {
744
+ luabind::object* functionObjectCopyForStoring = new luabind::object (*pair.second ->GetLuabindObject ());
745
+ outFunctionNamesAndObjects.try_emplace (pair.first , new LuabindObjectWrapper (functionObjectCopyForStoring, filePath));
746
+ }
745
747
}
746
748
747
749
return 0 ;
You can’t perform that action at this time.
0 commit comments