OpenRCT2/OpenRCT2

Plugin: async IDisposable.dispose leaks memory

Opened this issue · 0 comments

Operating System

Macos

OpenRCT2 build

0.4.10

Base game

RollerCoaster Tycoon 2

Area(s) with this issue?

This is a development issue

Describe the issue

In my plugin that has an async implementation, when using IntelOrcas' async nextTick implementation with a ES5 polyfill for promises, calling dispose isn't enough to free the memory, and it leaks.

Here's the original suggested implementation, and mine that explicity sets the handle to undefined (fixes the issue).

I wonder if it's something to do with the Promise/async polyfill>JS transpilation, because I don't think this is always an issue.

Steps to reproduce

This plugin release leaks memory, where I believe the newest has fixed the problem by explicitly setting the handle to undefined.

Attachments

No response