aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorfrsfnrrg <frsfnrrg@users.noreply.github.com>2018-07-17 10:42:48 -0400
committerfrsfnrrg <frsfnrrg@users.noreply.github.com>2018-07-17 10:42:48 -0400
commitb3014f7b168eb074bd071ee7cb930d74158a2895 (patch)
treec7168158be504f602fdf544167f01190b154392c /sway/tree/view.c
parentf516dbfb6d3380de24751de9a3f3156ece869e02 (diff)
Fix uninitialized pointer in view_unmap
Otherwise, sway crashes due to uninitialized pointer dereference when AddressSanitizer is active.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 70ab9364..fc31699c 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -621,16 +621,16 @@ void view_unmap(struct sway_view *view) {
view->urgent_timer = NULL;
}
- struct sway_container *parent;
struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE);
+ struct sway_container *parent;
if (view->is_fullscreen) {
ws->sway_workspace->fullscreen = NULL;
parent = container_destroy(view->swayc);
arrange_windows(ws->parent);
} else {
- struct sway_container *parent = container_destroy(view->swayc);
+ parent = container_destroy(view->swayc);
arrange_windows(parent);
}
if (parent->type >= C_WORKSPACE) { // if the workspace still exists