From 76b55651b6f6eba7dcfa6b01db1995e2a63b6ca8 Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 15 Jul 2024 08:43:06 +0200 Subject: [PATCH] Stop (and discard) the replay before tearing down the scripting engine (#22293) Fixes a shutdown crash on tearing down Duktape values after their context has already been destroyed. Fixes #22056 --- distribution/changelog.txt | 1 + src/openrct2/Context.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 21bbccbf79..0e536d81d5 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Feature: [OpenMusic#54] Added Progressive ride music style (feat. Approaching Nirvana). - Change: [#22230] The plugin/script engine is now initialised off the main thread. - Change: [#22251] Hide author info in the scenery window unless debug tools are active. +- Fix: [#22056] Potential crash upon exiting the game. - Fix: [#22208] Cursor may fail to register hits in some cases. 0.4.12 (2024-07-07) diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 11c71f8ee5..4557d6f5ad 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -195,6 +195,7 @@ namespace OpenRCT2 #endif GameActions::ClearQueue(); + _replayManager->StopRecording(true); #ifndef DISABLE_NETWORK _network.Close(); #endif