terminal/src/cascadia
Leonard Hecker ac265aab99
Fix TerminalControl crash on exit (#10031)
## Summary of the Pull Request

ControlCore's _renderer (IRenderTarget) is allocated as std::unique_ptr,
but is given to Terminal::CreateFromSettings as a reference.
ControlCore::Close deallocates the _renderer, but if ThrottledFuncs
are still scheduled to call ControlCore::UpdatePatternLocations
it'll cause Terminal::UpdatePatterns to be called, which in turn ends up
accessing the deallocated IRenderTarget reference and lead to a crash.

A proper solution with shared pointers is nontrivial and should be
attempted at a later point in time. This solution moves the teardown of
the _renderer into ControlCore::~ControlCore, where we can be certain
that no further strong references are held by ThrottledFuncs.

## PR Checklist
* [x] Closes #9910
* [x] I work here
* [x] Tests added/passed

## Validation Steps Performed

The crash is a race condition and inherently hard to reproduce.
During validation this PR didn't appear to introduce new crashes.
2021-05-04 21:17:37 +00:00
..
CascadiaPackage Remove bug fixes which aren't needed in VS 16.9 (#9953) 2021-04-28 10:43:05 +00:00
inc Add globalSummon action (#9854) 2021-04-28 17:13:28 -05:00
LocalTests_SettingsModel Implement UI for choosing default terminal inside Settings page (#9907) 2021-04-28 10:43:30 +00:00
LocalTests_TerminalApp Fix TabManagement to use tab object rather than index (#9924) 2021-04-23 22:25:20 +00:00
PublicTerminalCore Exclude more rarely-used stuff from Windows headers (#8513) 2020-12-11 19:35:23 +00:00
Remoting When the window is summoned and is already active, minimize it. (#9963) 2021-04-28 18:57:14 -05:00
ShellExtension Move Branding into common props (#9668) 2021-03-30 18:08:53 -05:00
TerminalApp Add globalSummon action (#9854) 2021-04-28 17:13:28 -05:00
TerminalAzBridge Update C++/WinRT to 2.0.210309.3 (#9437) 2021-03-10 16:04:59 -06:00
TerminalConnection Add names to threads to make debugging a slight bit easier (#9801) 2021-04-14 10:56:52 +00:00
TerminalControl Fix TerminalControl crash on exit (#10031) 2021-05-04 21:17:37 +00:00
TerminalCore Split TermControl into a Core, Interactivity, and Control layer (#9820) 2021-04-27 15:50:45 +00:00
TerminalSettingsEditor Implement UI for choosing default terminal inside Settings page (#9907) 2021-04-28 10:43:30 +00:00
TerminalSettingsModel When the window is summoned and is already active, minimize it. (#9963) 2021-04-28 18:57:14 -05:00
UnitTests_Control Split TermControl into a Core, Interactivity, and Control layer (#9820) 2021-04-27 15:50:45 +00:00
UnitTests_Remoting When the window is summoned and is already active, minimize it. (#9963) 2021-04-28 18:57:14 -05:00
UnitTests_TerminalCore Fix TerminalControl crash on exit (#10031) 2021-05-04 21:17:37 +00:00
ut_app Implement UI for choosing default terminal inside Settings page (#9907) 2021-04-28 10:43:30 +00:00
WindowsTerminal When the window is summoned and is already active, minimize it. (#9963) 2021-04-28 18:57:14 -05:00
WindowsTerminalUniversal Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
WinRTUtils Remove bug fixes which aren't needed in VS 16.9 (#9953) 2021-04-28 10:43:05 +00:00
WpfTerminalControl Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
WpfTerminalTestNetCore Auto-format our XAML files and enforce in CI (#9589) 2021-03-29 17:09:38 -05:00
wt Build and ship an actual binary named wt that just launches WT (#6860) 2020-07-10 22:41:37 +00:00
CascadiaResources.build.items Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00