Unload objects from context destructor.

This commit is contained in:
Matt 2018-08-29 13:46:56 +02:00
parent ccf12befd5
commit 1ca41da2aa
1 changed files with 7 additions and 0 deletions

View File

@ -135,6 +135,13 @@ namespace OpenRCT2
~Context() override
{
// Requires this as otherwise it will try to access Instance from other destructors.
// after setting Instance to nullptr.
if (_objectManager)
{
_objectManager->UnloadAll();
}
window_close_all();
gfx_object_check_all_images_freed();
gfx_unload_g2();