view_destroy: unmap surface if it isn't yet

Otherwise, we're left with an invalid link in the view list.
This commit is contained in:
Jente Hidskes 2019-01-04 17:24:42 +01:00
parent 2b8ee61d8b
commit 3ef0fc3867
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

3
view.c
View file

@ -97,6 +97,9 @@ view_destroy(struct cg_view *view)
struct cg_server *server = view->server;
bool terminate = view_is_primary(view);
if (view->wlr_surface != NULL) {
view_unmap(view);
}
free(view);
/* If this was our primary view, exit. */