[PR #10042] [MERGED] Fix crash on exit introduced in ac265aa #27871

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10042
Author: @lhecker
Created: 5/6/2021
Status: Merged
Merged: 5/12/2021
Merged by: @undefined

Base: mainHead: dev/lhecker/fix-exit-crash


📝 Commits (1)

📊 Changes

3 files changed (+19 additions, -28 deletions)

View changed files

📝 src/cascadia/TerminalControl/ControlCore.cpp (+2 -20)
📝 src/cascadia/TerminalControl/ControlCore.h (+6 -1)
📝 src/cascadia/TerminalControl/TermControl.h (+11 -7)

📄 Description

Summary of the Pull Request

ControlCore::AttachUiaEngine receives a IRenderEngine as a raw pointer,
which TermControl owns. We must ensure that we first destroy the
ControlCore before the UiaEngine instance (both owned by TermControl).
Otherwise a deallocated IRenderEngine is accessed when
ControlCore calls Renderer::TriggerTeardown.

References

This crash was introduced in #10031.

PR Checklist

  • I work here
  • Tests added/passed

Validation Steps Performed

  • Run accevent.exe to cause a UiaEngine to be attached to a TermControl.
  • Close the current tab
  • Ensured no crashes occur

🔄 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/10042 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 5/6/2021 **Status:** ✅ Merged **Merged:** 5/12/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/fix-exit-crash` --- ### 📝 Commits (1) - [`f470f49`](https://github.com/microsoft/terminal/commit/f470f49962be93d20aafdd5faa51e10c28caae5d) Fix crash on exit introduced in ac265aa ### 📊 Changes **3 files changed** (+19 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+2 -20) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+6 -1) 📝 `src/cascadia/TerminalControl/TermControl.h` (+11 -7) </details> ### 📄 Description ## Summary of the Pull Request ControlCore::AttachUiaEngine receives a IRenderEngine as a raw pointer, which TermControl owns. We must ensure that we first destroy the ControlCore before the UiaEngine instance (both owned by TermControl). Otherwise a deallocated IRenderEngine is accessed when ControlCore calls Renderer::TriggerTeardown. ## References This crash was introduced in #10031. ## PR Checklist * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Run accevent.exe to cause a UiaEngine to be attached to a TermControl. * Close the current tab * Ensured no crashes occur --- <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:24:48 +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#27871