client: Support destroying GlobalList through wl_fixes#886
Conversation
And I guess if a future version of |
|
The other question here would be if we need to bind a It could also make sense for |
| pub fn destroy(self) { | ||
| if let Some(fixes) = self.fixes.get() { | ||
| fixes.destroy_registry(&self.registry); | ||
| } |
There was a problem hiding this comment.
After calling fixes.destroy_registry(), we also need to call Backend::destroy_object(). Compare https://github.com/rust-windowing/softbuffer/pull/218/changes which is probably still the only thing that's using wl_fixes in a wayland-rs client so far.
This PR also seems to be missing a call to fixes.destroy() to destroy the instance of wl_fixes itself. Probably in Drop.
There was a problem hiding this comment.
I have added the backend.destroy_object() call as well as fixes.destroy(), but to the destroy-method.
The reason being, that for #887 we technically could still be using the wl_fixes-object for acknowledging global removals, even after the GlobalList has been dropped.
This can be changed as well, if we decide to free the registry on Drop.
There was a problem hiding this comment.
The downside of this is that if GlobalList::destroy isn't called, that wl_fixes instance is leaked. But it isn't really a big deal to leak an object without any events, compared to leaking the registry. Since we'll need wl_fixes for #887, that seems acceptable.
afc25ab to
ea157ff
Compare
|
Testing in |
Mostly a perquisite for supporting wl_fixes v2, when that lands, but it doesn't hurt to expose the ability to destroy the registry. Luckily wl_fixes has no events yet, so this makes it really easy to bypass the clients
Stateand handle it fully internally.