# linux/x11: Do panic when unmapping/destroying of X11 window fails \(\#13262\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8524e87319401b0dfb30b23d02cfcd9da4244f18)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8524e87319401b0dfb30b23d02cfcd9da4244f18

Requested commit: 8524e87319401b0dfb30b23d02cfcd9da4244f18

Commit: 8524e87319401b0dfb30b23d02cfcd9da4244f18

Tree: e63b13ba8ba22fb05de9d569d5c1b069ef8f9ef3

Author: Thorsten Ball

Committer: GitHub

## Message

````
linux/x11: Do panic when unmapping/destroying of X11 window fails (#13262)

We saw this panic come up:

```
called `Result::unwrap()` on an `Err` value: IoError(Custom { kind: Other, error: UnknownError })
core::panicking::panic_fmt
core::result::unwrap_failed
<gpui::platform::linux::x11::window::X11Window as core::ops::drop::Drop>::drop
core::ptr::drop_in_place<gpui::platform::linux::x11::window::X11Window>
core::ptr::drop_in_place<gpui::window::Window>
gpui::app::AppContext::shutdown
gpui::app::AppContext::new::{{closure}}
gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run
gpui::app::App::run
zed::main
std::sys_common::backtrace::__rust_begin_short_backtrace
std::rt::lang_start::{{closure}}
std::rt::lang_start_internal
main
__libc_start_call_main
__libc_start_main_impl
_start
```

I'm not sure where exactly that error comes from, except from the X11
stuff. So let's be defensive and log error and only then tear down
everything.

I _think_ that if the error is repeatable that means we won't close the
window but instead just log errors, but I do think that's better than
panicking right now.

Release Notes:

- N/A
````

## Parents

- [59c005b086866dd85b831f7c8fa1e09119c12f0a](https://git.cafe/gitcafe/zed/commit/59c005b086866dd85b831f7c8fa1e09119c12f0a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8524e87319401b0dfb30b23d02cfcd9da4244f18?format=markdown)
