Skip to content

Commit

Permalink
MSIX: keep PowerRename local COM server in memory (microsoft#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyoyuppe authored and udit3333 committed Feb 19, 2020
1 parent 6b0ffbb commit 7d1c925
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/powerrename/UWPui/PowerRenameUWPUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ void ModuleRelease()
{
if (--g_dwModuleRefCount == 0)
{
PostThreadMessage(main_thread_id, WM_QUIT, 0, 0);
// Do nothing and keep the COM server in memory forever. We might want to introduce delayed shutdown and/or
// periodic polling whether a user has disabled us in settings. Tracking this in #1217
}
}
HINSTANCE g_hInst = 0;
Expand Down Expand Up @@ -95,9 +96,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
main_thread_id = GetCurrentThreadId();
winrt::init_apartment();
g_hInst = hInstance;
auto factory = std::make_unique<CPowerRenameClassLocalFactory>(CLSID_PowerRenameMenu);
CPowerRenameClassLocalFactory factory{CLSID_PowerRenameMenu};
DWORD token;
if (!SUCCEEDED(CoRegisterClassObject(CLSID_PowerRenameMenu, factory.get(), CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &token)))
if (!SUCCEEDED(CoRegisterClassObject(CLSID_PowerRenameMenu, &factory, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &token)))
{
return 1;
}
Expand Down

0 comments on commit 7d1c925

Please sign in to comment.