Skip to content

Commit

Permalink
Manually initialize the warnings vector to prevent a crash on launch (#…
Browse files Browse the repository at this point in the history
…8995)

## Summary of the Pull Request

Oops, winrt `IVector`s need to be manually initialized, when default-constructed `std::vector`s didn't. Simple oversight.

## PR Checklist
* [x] Closes #8986
* [x] I work here
* [x] A test would be great but ain't nobody got time for that.
* [n/a] Requires documentation to be updated

## Validation Steps Performed
Ran the terminal with 
```json

    "schemes" :
    [ {} ]
```
First the crash repro'd, now it doesn't.
  • Loading branch information
zadjii-msft authored Feb 2, 2021
1 parent 40ebe5a commit 9d71fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,7 @@ namespace winrt::TerminalApp::implementation
IVectorView<Profile> profiles,
IMapView<winrt::hstring, ColorScheme> schemes)
{
IVector<SettingsLoadWarnings> warnings;
IVector<SettingsLoadWarnings> warnings{ winrt::single_threaded_vector<SettingsLoadWarnings>() };

std::vector<ColorScheme> sortedSchemes;
sortedSchemes.reserve(schemes.Size());
Expand Down

1 comment on commit 9d71fa8

@github-actions

This comment was marked as off-topic.

Please sign in to comment.