KEMBAR78
Improve window thread termination by JohnMcPMS · Pull Request #5781 · microsoft/winget-cli · GitHub
Skip to content

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Oct 9, 2025

Change

Shut down the window thread as part of the TerminationSignalHandler destruction.
Properly unregister the window class after destroying the window on the thread.
Signal the shutdown via an atomic_bool.

Microsoft Reviewers: Open in CodeFlow

yao-msft
yao-msft previously approved these changes Oct 9, 2025
Copy link
Contributor

@yao-msft yao-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

BOOL getMessageResult;
while ((getMessageResult = GetMessage(&msg, m_windowHandle.get(), 0, 0)) != 0)
// Message loop, exits when the window handle has been destroyed
while (m_windowThreadShouldRun.load())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: do we need the load()

yao-msft
yao-msft previously approved these changes Oct 9, 2025
Copy link
Contributor

@yao-msft yao-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@yao-msft yao-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

#include <AppInstallerRuntime.h>
#include <winget/COMStaticStorage.h>

using namespace std::chrono_literals;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not needed anymore?

@JohnMcPMS JohnMcPMS merged commit 8ea16f8 into microsoft:master Oct 10, 2025
9 checks passed
@JohnMcPMS JohnMcPMS deleted the no-log-loop branch October 10, 2025 00:51
JohnMcPMS added a commit that referenced this pull request Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"C:\Windows\Temp\winget\defaultstate " prend l'espace disponible sur la machine

2 participants