xdg_shell_v6: Reset role data 42/295242/2
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 2 Jun 2023 04:36:09 +0000 (13:36 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Tue, 4 Jul 2023 07:03:00 +0000 (07:03 +0000)
It has to reset role data when xdg_toplevel_v6 is destroyed.
Otherwise, the role->commit() callback can be called with a freed
toplevel pointer and the process would end up being crashed.

Change-Id: Ida94443c1bb256847b8a1cbadd69db94afef452b

src/xdg_shell_v6/xdg_toplevel_v6.c

index d15eee1..194dbe7 100644 (file)
@@ -225,6 +225,7 @@ error_out:
 void
 destroy_xdg_toplevel_v6(struct ds_xdg_toplevel_v6 *toplevel)
 {
+    ds_surface_reset_role_data(toplevel->base->ds_surface);
     wl_resource_set_user_data(toplevel->resource, NULL);
     free(toplevel);
 }