Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.
This repository was archived by the owner on May 8, 2024. It is now read-only.

Weak Event Emitter #14

@dinhero21

Description

@dinhero21

This probably shouldn't be an issue but I'm just creating this for means of documentation.

The way IO Events are handled (more specifically the Mouse Prioritization System) uses a wacky EventFrame system that requires you to call free() when you don't need the object anymore.

Of course, this is very error-prone as memory leaks can easily be created by simply forgetting to call free() which should be the garbage collector's job anyway!

So, the idea is to create an alternative to EventTargets / node:events that uses WeakMaps (or WeakRef Maps for iteratability) that wouldn't keep strong references that would make it automatically garbage-collectable.

(this might be best made into its own standalone package, weak-events anyon- oh wait that's already taken)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions