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

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

Original Pull Request: https://github.com/microsoft/terminal/pull/10042

State: closed
Merged: Yes


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
**Original Pull Request:** https://github.com/microsoft/terminal/pull/10042 **State:** closed **Merged:** Yes --- ## 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
claunia added the pull-request label 2026-01-31 09:24:49 +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#27874