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

A lot of the MTL API is missing alloc/init/release declarations. #8

Open
LunaTheFoxgirl opened this issue Feb 15, 2024 · 3 comments
Open

Comments

@LunaTheFoxgirl
Copy link
Contributor

A large part of the API has no way to release references to the classes created, this in my testing can result in some memory leaks.
A lower class than Object should probably be added, which provides just an interface to retain, release, autorelease and retainCount

@MrcSnm
Copy link
Owner

MrcSnm commented Feb 15, 2024

https://github.com/MrcSnm/D-objective-c/blob/main/source/objc/runtime.d#L72

They are actually implemented. NSObject has those functions and as you can see, all of them are extending this class.

@LunaTheFoxgirl
Copy link
Contributor Author

@MrcSnm
Copy link
Owner

MrcSnm commented Feb 19, 2024

MTLRenderPassDescriptor does not, for example. https://github.com/MrcSnm/D-Metal-Binding/blob/main/source/metal/metal.d#L527-L530

or MTLDrawable https://github.com/MrcSnm/D-Metal-Binding/blob/main/source/metal/metal.d#L973-L978

On the interface, they do not actually contain the methods of the objective-c NSObject. But you can always cast your object to this class since everything extends from NSObject. But yeah on the descriptors that should be fixed

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

No branches or pull requests

2 participants