Skip to content

Commit 941bef1

Browse files
committed
Unify XAML connection failure cleanup
1 parent d95836f commit 941bef1

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

‎Src/StartMenu/StartMenuHelper/Win11StartButtonTap.cpp‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -808,22 +808,19 @@ static void EnsureConnection( void )
808808
return;
809809

810810
HMODULE moduleReference = NULL;
811-
if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCTSTR)&ConnectThread, &moduleReference))
812-
{
813-
g_ConnectStarted = false;
814-
return;
815-
}
816-
817-
HANDLE thread = CreateThread(NULL, 0, ConnectThread, moduleReference, 0, NULL);
818-
if (thread)
819-
{
820-
CloseHandle(thread);
821-
}
822-
else
811+
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCTSTR)&ConnectThread, &moduleReference))
823812
{
813+
HANDLE thread = CreateThread(NULL, 0, ConnectThread, moduleReference, 0, NULL);
814+
if (thread)
815+
{
816+
CloseHandle(thread);
817+
return;
818+
}
824819
FreeLibrary(moduleReference);
825-
g_ConnectStarted = false;
826820
}
821+
822+
// A worker was not started, so connection can be attempted again later.
823+
g_ConnectStarted = false;
827824
}
828825

829826
extern "C" void StartWin11StartButtonTap( BOOL enabled, BOOL allTaskbars )

0 commit comments

Comments
 (0)