Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[orx-gui] Make gui.shutdown() clean up after itself #258

Open
hamoid opened this issue Aug 10, 2022 · 3 comments
Open

[orx-gui] Make gui.shutdown() clean up after itself #258

hamoid opened this issue Aug 10, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@hamoid
Copy link
Member

hamoid commented Aug 10, 2022

Motivation

I would like to be able to extend(gui), later do gui.shutdown() and once again extend(gui).

Currently gui adds listeners for key presses and maintains mutable lists which are not cleared on shutdown. It seems to assume that a program has one gui which exists for the duration of the program.

More generally, there's gui.add() but no gui.remove(), there's program.extend() but no program.drop().

Help make it happen!

I am willing to submit a PR to implement this change, but would need some guidance.

@hamoid hamoid added the enhancement New feature or request label Aug 10, 2022
@Treide1
Copy link

Treide1 commented Jun 4, 2023

On that note, I see a similar problem with [orx-compositor].
There are funtions provided ike deepDestroy that would allow cleanup, but the important vars themselfs are kept private.

This follows the same logic of providing creation, but no kind of destruction.

In general, I would welcome opening up resources to follow the acquire-release pattern.
This allows for dynamic usage of resources, acquiring and releasing them as needed.

Note:
My personal motivation is using orx-compisitor for scenes (like theaters scenes) were I have to cleanup resources after a scene completes. (I define many scenes in advance, but only one is in active use at any point.)
I hope it's understandable how this benefit similar dynamic projects.

@Treide1
Copy link

Treide1 commented Jun 4, 2023

I am also willing to write a PR for orx-compositor specifically.
I would like a second opionion before authoring it though.

@edwinRNDR
Copy link
Member

Admittedly orx-compositor is written entirely without thinking of releasing resources.

OPENRNDR has a hidden resource manager provided by Session, it is primarily used to release resources in the live coding mode provided by orx-olive. It may be worthwhile to formalize/untangle what Session does and document the API. It may be possible to create a scene inside a Session scope and have all the resources cleaned up automatically by closing the session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants