Fix showing a dialog multiple times (#12625)

After the dialog is displayed, always clear it out. If we don't, we won't be able to display another!

* regressed in #12517.
* [x] Fixes #12622.
This commit is contained in:
Mike Griese
2022-03-10 08:16:10 -06:00
committed by GitHub
parent f84ccad42d
commit 2e78ebfdc7

View File

@@ -348,7 +348,11 @@ namespace winrt::TerminalApp::implementation
}
_dialog = dialog;
// GH#12622: After the dialog is displayed, always clear it out. If we
// don't, we won't be able to display another!
const auto cleanup = wil::scope_exit([this]() {
_dialog = nullptr;
});
// IMPORTANT: This is necessary as documented in the ContentDialog MSDN docs.
// Since we're hosting the dialog in a Xaml island, we need to connect it to the
// xaml tree somehow.