shell: destroy desktop_shell client on exit
If the compositor is shutting down while the desktop_shell still exists, we leaked some resources by not destroying the client record. Call wl_client_destroy() on the desktop_shell client, if it exists during shutdown. Fixes some Valgrind errors. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
+3
-3
@@ -1238,6 +1238,9 @@ shell_destroy(struct wlsc_shell *base)
|
|||||||
{
|
{
|
||||||
struct wl_shell *shell = container_of(base, struct wl_shell, shell);
|
struct wl_shell *shell = container_of(base, struct wl_shell, shell);
|
||||||
|
|
||||||
|
if (shell->child.client)
|
||||||
|
wl_client_destroy(shell->child.client);
|
||||||
|
|
||||||
free(shell->screensaver.path);
|
free(shell->screensaver.path);
|
||||||
free(shell);
|
free(shell);
|
||||||
}
|
}
|
||||||
@@ -1296,9 +1299,6 @@ shell_init(struct wlsc_compositor *ec)
|
|||||||
wlsc_compositor_add_binding(ec, 0, BTN_LEFT, 0,
|
wlsc_compositor_add_binding(ec, 0, BTN_LEFT, 0,
|
||||||
click_to_activate_binding, ec);
|
click_to_activate_binding, ec);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ec->shell = &shell->shell;
|
ec->shell = &shell->shell;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user