Skip to content

Commit

Permalink
Fix showing a dialog multiple times (#12625)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zadjii-msft committed Mar 10, 2022
1 parent f84ccad commit 2e78ebf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cascadia/TerminalApp/AppLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2e78ebf

Please sign in to comment.