diff options
author | Mariusz Bialonczyk <manio@skyboo.net> | 2018-08-05 16:59:10 +0200 |
---|---|---|
committer | Mariusz Bialonczyk <manio@skyboo.net> | 2018-08-05 17:04:20 +0200 |
commit | 776b9b7e1fa72ebc4f7e79de280ea5dd9901787e (patch) | |
tree | df437756a007d951b6392fe61593b5370bcd1199 /sway/tree/view.c | |
parent | Merge pull request #2422 from ggreer/compiler-errors (diff) | |
download | sway-776b9b7e1fa72ebc4f7e79de280ea5dd9901787e.tar.gz sway-776b9b7e1fa72ebc4f7e79de280ea5dd9901787e.tar.zst sway-776b9b7e1fa72ebc4f7e79de280ea5dd9901787e.zip |
Fix segv when sway is terminating
I've got the following SIGSEGV when terminating sway:
```
Program terminated with signal SIGSEGV, Segmentation fault.
0x00005607dc603af5 in view_unmap (view=0x5607dcb3d350) at ../sway/tree/view.c:599
599 if (surviving_ancestor->type >= C_WORKSPACE) {
```
surviving_ancestor was NULL at that time
This commit is trying to fix this problem.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 9465b3a1..06cef900 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -596,7 +596,7 @@ void view_unmap(struct sway_view *view) { | |||
596 | struct sway_container *surviving_ancestor = container_destroy(view->swayc); | 596 | struct sway_container *surviving_ancestor = container_destroy(view->swayc); |
597 | 597 | ||
598 | // If the workspace wasn't reaped | 598 | // If the workspace wasn't reaped |
599 | if (surviving_ancestor->type >= C_WORKSPACE) { | 599 | if (surviving_ancestor && surviving_ancestor->type >= C_WORKSPACE) { |
600 | struct sway_container *ws = surviving_ancestor->type == C_WORKSPACE ? | 600 | struct sway_container *ws = surviving_ancestor->type == C_WORKSPACE ? |
601 | surviving_ancestor : | 601 | surviving_ancestor : |
602 | container_parent(surviving_ancestor, C_WORKSPACE); | 602 | container_parent(surviving_ancestor, C_WORKSPACE); |