From 105009f3f80caf1b855716a2e09ffcda4519d838 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 15 Feb 2022 19:44:21 +0000 Subject: [PATCH] Fix #16591: Plugins: setInterval and setTimeout is not disposed... --- distribution/changelog.txt | 1 + src/openrct2/scripting/ScriptEngine.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e67eb15d50..0da6356503 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -44,6 +44,7 @@ - Fix: [#16535] Entering construction mode unblocks all paths. - Fix: [#16542] “Same price throughout park” status not correctly imported for RCT1 saves. - Fix: [#16572] Crash when trying to place track designs. +- Fix: [#16591] [Plugin] setInterval and setTimeout is not disposed when map unloads. - Fix: [objects#165] Glitch when Bengal Tiger Cars go through a corner. 0.3.5.1 (2021-11-21) diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 64ba4bbc3a..024cec05bd 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -725,7 +725,7 @@ DukValue ScriptEngine::ExecutePluginCall( bool isGameStateMutable) { DukStackFrame frame(_context); - if (func.is_function()) + if (func.is_function() && plugin->HasStarted()) { ScriptExecutionInfo::PluginScope scope(_execInfo, plugin, isGameStateMutable); func.push();