[PR #14228] [MERGED] Fix circular TermControl reference #30016

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14228
Author: @lhecker
Created: 10/15/2022
Status: ✅ Merged
Merged: 10/17/2022
Merged by: @undefined

Base: main ← Head: dev/lhecker/termcontrol-leak


📝 Commits (2)

  • 85b117b Fix circular TermControl reference
  • 533742f Fix settings reload

📊 Changes

2 files changed (+29 additions, -25 deletions)

View changed files

📝 src/cascadia/TerminalControl/ScrollBarVisualStateManager.cpp (+23 -20)
📝 src/cascadia/TerminalControl/ScrollBarVisualStateManager.h (+6 -5)

📄 Description

This regression was introduced in b3c9f01. Since TermControl is the XAML
object that owns its scrollbar and the scrollbar's VisualStateManager
a strong reference back to the TermControl results in a circular reference.

Validation Steps Performed

  • Set a breakpoint on TermControl::~TermControl()
  • Breakpoint hits on tab close ✅

🔄 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/14228 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 10/15/2022 **Status:** ✅ Merged **Merged:** 10/17/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/termcontrol-leak` --- ### 📝 Commits (2) - [`85b117b`](https://github.com/microsoft/terminal/commit/85b117b451ae04f88e6a3584145e0ae4856f7020) Fix circular TermControl reference - [`533742f`](https://github.com/microsoft/terminal/commit/533742fb69ee44509849d981cb2328881f87ebd1) Fix settings reload ### 📊 Changes **2 files changed** (+29 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/ScrollBarVisualStateManager.cpp` (+23 -20) 📝 `src/cascadia/TerminalControl/ScrollBarVisualStateManager.h` (+6 -5) </details> ### 📄 Description This regression was introduced in b3c9f01. Since `TermControl` is the XAML object that owns its scrollbar and the scrollbar's `VisualStateManager` a strong reference back to the `TermControl` results in a circular reference. ## Validation Steps Performed * Set a breakpoint on `TermControl::~TermControl()` * Breakpoint hits on tab close ✅ --- <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:38:11 +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#30016