diff --git a/distribution/changelog.txt b/distribution/changelog.txt index d1fb7b809e..181d9c1061 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -15,6 +15,7 @@ - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14649] ImageImporter incorrectly remaps colours outside the RCT2 palette. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). +- Fix: [#14741] Crash when exiting OpenRCT2 on macOS. - Fix: [#15096] Crash when placing entrances in the scenario editor near the map corner. - Fix: [#15136] Exported SV6 files cause vanilla RCT2 to hang. - Fix: [#15142] ToonTowner's mine roofs were moved into the pirate theme scenery group instead of the mine theme scenery group. diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 46ccdd559d..f831f9cb56 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -170,3 +170,12 @@ void Painter::ReleaseSession(paint_session* session) session->PaintEntryChain.Clear(); _freePaintSessions.push_back(session); } + +Painter::~Painter() +{ + for (auto&& session : _paintSessionPool) + { + ReleaseSession(session.get()); + } + _paintSessionPool.clear(); +} diff --git a/src/openrct2/paint/Painter.h b/src/openrct2/paint/Painter.h index d776f6f557..7bcc9ba2f0 100644 --- a/src/openrct2/paint/Painter.h +++ b/src/openrct2/paint/Painter.h @@ -49,6 +49,7 @@ namespace OpenRCT2 paint_session* CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags); void ReleaseSession(paint_session* session); + ~Painter(); private: void PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text);