# debugger: Fix deadlock in on_app_quit with debugger running \(\#29372\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c3177e6f5b22baf35cc28dbe92e2401f7cd1db6e

Requested commit: c3177e6f5b22baf35cc28dbe92e2401f7cd1db6e

Commit: c3177e6f5b22baf35cc28dbe92e2401f7cd1db6e

Tree: 5a61de17f965feaf72313ed26590465b52f351a2

Author: Anthony Eid

Committer: GitHub

## Message

```
debugger: Fix deadlock in on_app_quit with debugger running (#29372)

This fixes a deadlock that would occur when `DapStore` had its on quit
handler called. The deadlock was caused by `DapStore` spawning on the
main thread while `App::shutdown` blocks the main thread.

We added a debug_panic in GPUI that panics if a foreground task is
spawned while the App context is shutting down. This will help tests
catch hangs in `cx.on_app_quit` calls.

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

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

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