[PR #11440] [MERGED] Try to fix crash on close with saving enabled #28576

Open
opened 2026-01-31 09:29:23 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11440
Author: @Rosefield
Created: 10/6/2021
Status: Merged
Merged: 10/20/2021
Merged by: @PankajBhojwani

Base: mainHead: bug/dont-crash-on-close


📝 Commits (2)

  • 2233047 dont crash if we try to save the window layout while we are closing, and try to avoid saving at all
  • add7d0a Remove ourself from the list of peasants before we start destructing this way any concurrent event handlers will finish, and future ones will not include us.

📊 Changes

2 files changed (+38 additions, -13 deletions)

View changed files

📝 src/cascadia/WindowsTerminal/AppHost.cpp (+37 -13)
📝 src/cascadia/WindowsTerminal/AppHost.h (+1 -0)

📄 Description

Don't crash if we try to save the window layout while we are closing, and try to avoid saving at all.

Might impact #11354

Detailed Description of the Pull Request / Additional comments

  • Revoke the event handler/save throttler so we don't even try to get the window layout when we are closing
  • Try to check for nullptrs, but then apply try {} CATCH_LOG() liberally

Validation Steps Performed

The happy path of saving normally is still fine, but I haven't been unlucky enough to trigger the crash myself.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11440 **Author:** [@Rosefield](https://github.com/Rosefield) **Created:** 10/6/2021 **Status:** ✅ Merged **Merged:** 10/20/2021 **Merged by:** [@PankajBhojwani](https://github.com/PankajBhojwani) **Base:** `main` ← **Head:** `bug/dont-crash-on-close` --- ### 📝 Commits (2) - [`2233047`](https://github.com/microsoft/terminal/commit/22330477c532bbf846cb7ebcaec86fc86cf07734) dont crash if we try to save the window layout while we are closing, and try to avoid saving at all - [`add7d0a`](https://github.com/microsoft/terminal/commit/add7d0ad737a1acf66d65b855ff821ad84f7d650) Remove ourself from the list of peasants before we start destructing this way any concurrent event handlers will finish, and future ones will not include us. ### 📊 Changes **2 files changed** (+38 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+37 -13) 📝 `src/cascadia/WindowsTerminal/AppHost.h` (+1 -0) </details> ### 📄 Description Don't crash if we try to save the window layout while we are closing, and try to avoid saving at all. Might impact #11354 ## Detailed Description of the Pull Request / Additional comments - Revoke the event handler/save throttler so we don't even try to get the window layout when we are closing - Try to check for nullptrs, but then apply `try {} CATCH_LOG()` liberally ## Validation Steps Performed The happy path of saving normally is still fine, but I haven't been unlucky enough to trigger the crash myself. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:29:23 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28576