Skip to content

Commit

Permalink
Remove default_interface from Monarch (#12856)
Browse files Browse the repository at this point in the history
This is all of course, conjecture. This crash is totally wild and makes no sense at all. But, we're hoping that this fixes it. This should also make calls to the Monarch a little easier.

You may be asking yourself - why aren't I doing this for the Peasant too? Well, because the Peasant simply doesn't crash like the monarch does. I'm not gonna touch something that's not broken _during ask mode_.

References #12774. We can close the bug if it is verified fixed.

(cherry picked from commit b64fd77)
Service-Card-Id: 80383091
Service-Version: 1.13
  • Loading branch information
zadjii-msft authored and DHowett committed Apr 8, 2022
1 parent a8cc9d1 commit ea552b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cascadia/Remoting/Monarch.idl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace Microsoft.Terminal.Remoting
event Windows.Foundation.TypedEventHandler<Object, QuitAllRequestedArgs> QuitAllRequested;
};

[default_interface] runtimeclass Monarch : IMonarch
runtimeclass Monarch : [default] IMonarch
{
Monarch();
};
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/Remoting/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
//
// * If we're running unpackaged: the .winmd must be a sibling of the .exe
// * If we're running packaged: the .winmd must be in the package root
_monarch = create_instance<Remoting::Monarch>(Monarch_clsid,
CLSCTX_LOCAL_SERVER);
_monarch = create_instance<Remoting::IMonarch>(Monarch_clsid,
CLSCTX_LOCAL_SERVER);
}

// NOTE: This can throw! Callers include:
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/Remoting/WindowManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
bool _shouldCreateWindow{ false };
bool _isKing{ false };
DWORD _registrationHostClass{ 0 };
winrt::Microsoft::Terminal::Remoting::Monarch _monarch{ nullptr };
winrt::Microsoft::Terminal::Remoting::IMonarch _monarch{ nullptr };
winrt::Microsoft::Terminal::Remoting::Peasant _peasant{ nullptr };

wil::unique_event _monarchWaitInterrupt;
Expand Down

0 comments on commit ea552b2

Please sign in to comment.