Closes #ISSUE
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
@@ -186,6 +186,14 @@ impl HeadlessAppContext {
}
}
+impl Drop for HeadlessAppContext {
+ fn drop(&mut self) {
+ // Shut down the app so windows are closed and entity handles are
+ // released before the LeakDetector runs.
+ self.app.borrow_mut().shutdown();
+ }
+}
+
impl AppContext for HeadlessAppContext {
fn new<T: 'static>(&mut self, build_entity: impl FnOnce(&mut Context<T>) -> T) -> Entity<T> {
let mut app = self.app.borrow_mut();