1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Improve safety on event handlers from windows

This commit is contained in:
Ted John
2022-02-21 00:40:31 +00:00
parent 8f34029e89
commit 3864795a08
2 changed files with 4 additions and 3 deletions

View File

@@ -868,8 +868,9 @@ DukValue ScriptEngine::ExecutePluginCall(
return ExecutePluginCall(plugin, func, dukUndefined, args, isGameStateMutable);
}
// Must pass plugin by-value, a JS function could destroy the original reference
DukValue ScriptEngine::ExecutePluginCall(
const std::shared_ptr<Plugin>& plugin, const DukValue& func, const DukValue& thisValue, const std::vector<DukValue>& args,
std::shared_ptr<Plugin> plugin, const DukValue& func, const DukValue& thisValue, const std::vector<DukValue>& args,
bool isGameStateMutable)
{
DukStackFrame frame(_context);