Skip to content

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Feb 27, 2025

I've been thinking a helper like this could be handy, since I end up implementing Drop on types that contain proxies often. So this would save some code, and also allow destructuring of those wrapper types since they won't have their own Drop impls.

The same idea was also suggested in #596.

I need to test this in a few use cases, and check a few things (probably should test the object version; make sure wayland doesn't allow multiple destructors or destructors with arguments, or handle those somehow; compare the _destroy code generated in libwayland.)

@ids1024
Copy link
Member Author

ids1024 commented Apr 25, 2025

Looks like this is failing to generate bindings for https://wayland.app/protocols/color-management-v1 since it has objects with "destructor" requests called ::create that take a new_id argument, rather than no arguments like normal destructors.

(This is in contrast to the design of https://wayland.app/protocols/linux-dmabuf-v1, where destroy is actually a separate request that has to be sent after create/create_immed.)

@ids1024
Copy link
Member Author

ids1024 commented Apr 25, 2025

We wouldn't want to restrict it to only destructors called ::destroy, since it should probably work with globals that have a ::release destructor.

Could restrict it to just destructors that take no arguments.

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

Successfully merging this pull request may close these issues.

1 participant