Fabric API

Fabric API

112M Downloads

Deprecate and remove EventFactory#invalidate

apple502j opened this issue ยท 0 comments

commented

EventFactory#invalidate is used to enable profiling for event handlers added before the profiling is enabled. However, this requires the events to be stored globally, causing memory leaks. While the leak can be mitigated using weakref, it's still a bad practice, given events are created thousands of times during the lifetime.

This method is not used by any mods. Therefore I suggest forRemoval=true deprecation of this method, and dropping it in the next big Minecraft version (perhaps along with NbtType const).

See #2848