Some code review
This commit is contained in:
parent
91f18453bf
commit
e386d6f6c7
|
@ -171,13 +171,12 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
|||
const auto peasantSearch = _peasants.find(_ourPeasantId);
|
||||
if (peasantSearch != _peasants.end())
|
||||
{
|
||||
const auto p = peasantSearch->second;
|
||||
p.Quit();
|
||||
peasantSearch->second.Quit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Somehow we don't have our own peasant, but we are trying to quit
|
||||
// so just blow up.
|
||||
// Somehow we don't have our own peasant, this should never happen.
|
||||
// We are trying to quit anyways so just fail here.
|
||||
FAIL_FAST();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,8 +325,11 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
|||
TraceLoggingKeyword(TIL_KEYWORD_TRACE));
|
||||
|
||||
// If the peasant asks us to quit we should not try to act in future elections.
|
||||
_peasant.QuitRequested([this](auto&&, auto&&) {
|
||||
_monarchWaitInterrupt.SetEvent();
|
||||
_peasant.QuitRequested([weakThis{ get_weak() }](auto&&, auto&&) {
|
||||
if (auto wm = weakThis.get())
|
||||
{
|
||||
wm._monarchWaitInterrupt.SetEvent();
|
||||
}
|
||||
});
|
||||
|
||||
return _peasant;
|
||||
|
|
Loading…
Reference in a new issue