sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 37471ac649cf594975b4e0ab09291c116c66feec
parent 600676688a47bde05bc12110818127c5300dd876
Author: frsfnrrg <frsfnrrg@users.noreply.github.com>
Date:   Tue, 17 Jul 2018 11:21:32 -0400

Fix memory leak in handle_layer_shell_surface

Diffstat:
Msway/desktop/layer_shell.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c @@ -325,12 +325,6 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { layer_surface->client_pending.margin.bottom, layer_surface->client_pending.margin.left); - struct sway_layer_surface *sway_layer = - calloc(1, sizeof(struct sway_layer_surface)); - if (!sway_layer) { - return; - } - if (!layer_surface->output) { // Assign last active output struct sway_container *output = NULL; @@ -352,6 +346,12 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { layer_surface->output = output->sway_output->wlr_output; } + struct sway_layer_surface *sway_layer = + calloc(1, sizeof(struct sway_layer_surface)); + if (!sway_layer) { + return; + } + sway_layer->surface_commit.notify = handle_surface_commit; wl_signal_add(&layer_surface->surface->events.commit, &sway_layer->surface_commit);