[PR #15231] [MERGED] Remove the window thread from the list of threads before nulling the AppHost #30513

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15231
Author: @zadjii-msft
Created: 4/24/2023
Status: Merged
Merged: 4/25/2023
Merged by: @microsoft-github-policy-service[bot]

Base: mainHead: dev/migrie/b/MSFT-43995981


📝 Commits (3)

📊 Changes

3 files changed (+16 additions, -3 deletions)

View changed files

📝 src/cascadia/WindowsTerminal/WindowEmperor.cpp (+11 -1)
📝 src/cascadia/WindowsTerminal/WindowThread.cpp (+4 -2)
📝 src/cascadia/WindowsTerminal/WindowThread.h (+1 -0)

📄 Description

See https://github.com/microsoft/terminal/issues/14957#issuecomment-1520522722.

I think there's a race here that lets the WindowEmperor muck around with the window after it's done, but before we remove it from our list of threads.

This should remove the thread from the list, then null out the AppHost, then flush the XAML queue, preventing the A/V.

Closes MSFT:43995981


🔄 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/15231 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 4/24/2023 **Status:** ✅ Merged **Merged:** 4/25/2023 **Merged by:** [@microsoft-github-policy-service[bot]](https://github.com/apps/microsoft-github-policy-service) **Base:** `main` ← **Head:** `dev/migrie/b/MSFT-43995981` --- ### 📝 Commits (3) - [`b2c1a49`](https://github.com/microsoft/terminal/commit/b2c1a49353fc1482b276d81f358987025b3a2656) I think this should work - [`5e8b154`](https://github.com/microsoft/terminal/commit/5e8b1549f35103ed375aabd8e46438eeb71b3645) spel - [`e3aca8a`](https://github.com/microsoft/terminal/commit/e3aca8afeeb98b2c40a31e6b334a5af012c420b5) Oh sure of course I built the wrong VS window ### 📊 Changes **3 files changed** (+16 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WindowsTerminal/WindowEmperor.cpp` (+11 -1) 📝 `src/cascadia/WindowsTerminal/WindowThread.cpp` (+4 -2) 📝 `src/cascadia/WindowsTerminal/WindowThread.h` (+1 -0) </details> ### 📄 Description See https://github.com/microsoft/terminal/issues/14957#issuecomment-1520522722. I think there's a race here that lets the WindowEmperor muck around with the window after it's done, but before we remove it from our list of threads. This _should_ remove the thread from the list, _then_ null out the AppHost, then flush the XAML queue, preventing the A/V. Closes MSFT:43995981 --- <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:41:18 +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#30513