Skip to content

Commit 2ef7edb

Browse files
yuyoyuppeudit3333
authored andcommitted
MSIX: keep PowerRename local COM server in memory (microsoft#1222)
1 parent eb4a7d6 commit 2ef7edb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/modules/powerrename/UWPui/PowerRenameUWPUI.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ void ModuleRelease()
1818
{
1919
if (--g_dwModuleRefCount == 0)
2020
{
21-
PostThreadMessage(main_thread_id, WM_QUIT, 0, 0);
21+
// Do nothing and keep the COM server in memory forever. We might want to introduce delayed shutdown and/or
22+
// periodic polling whether a user has disabled us in settings. Tracking this in #1217
2223
}
2324
}
2425
HINSTANCE g_hInst = 0;
@@ -95,9 +96,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
9596
main_thread_id = GetCurrentThreadId();
9697
winrt::init_apartment();
9798
g_hInst = hInstance;
98-
auto factory = std::make_unique<CPowerRenameClassLocalFactory>(CLSID_PowerRenameMenu);
99+
CPowerRenameClassLocalFactory factory{CLSID_PowerRenameMenu};
99100
DWORD token;
100-
if (!SUCCEEDED(CoRegisterClassObject(CLSID_PowerRenameMenu, factory.get(), CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &token)))
101+
if (!SUCCEEDED(CoRegisterClassObject(CLSID_PowerRenameMenu, &factory, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &token)))
101102
{
102103
return 1;
103104
}

0 commit comments

Comments
 (0)