~emersion/public-inbox

wlr-randr: Destroy head and mode objects before disconnect v1 APPLIED

Isaac Freund: 1
 Destroy head and mode objects before disconnect

 1 files changed, 8 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/public-inbox/patches/39507/mbox | git am -3
Learn more about email & git

[PATCH wlr-randr] Destroy head and mode objects before disconnect Export this patch

The latest version of libwayland now prints warnings if we don't destroy
these.

warning: queue 0x56103a63e390 destroyed while proxies still attached:
  zwlr_output_mode_v1@4278190123 still attached
  zwlr_output_mode_v1@4278190122 still attached
  ...
---
 main.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 82c8466..33a1656 100644
--- a/main.c
+++ b/main.c
@@ -754,7 +754,14 @@ int main(int argc, char *argv[]) {
		// This space intentionally left blank
	}

	// TODO: destroy heads
	struct randr_head *head, *tmp_head;
	wl_list_for_each_safe(head, tmp_head, &state.heads, link) {
	    struct randr_mode *mode, *tmp_mode;
	    wl_list_for_each_safe(mode, tmp_mode, &head->modes, link) {
            zwlr_output_mode_v1_destroy(mode->wlr_mode);
	    }
	    zwlr_output_head_v1_destroy(head->wlr_head);
	}
	zwlr_output_manager_v1_destroy(state.output_manager);
	wl_registry_destroy(registry);
	wl_display_disconnect(display);
-- 
2.39.1
Pushed with a few changes:

- s/spaces/tabs/ for indentation
- Free the strings and structs as well

Thanks!