We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d40a4ac commit 438b642Copy full SHA for 438b642
1 file changed
src/AppInstallerCommonCore/Downloader.cpp
@@ -14,6 +14,7 @@
14
#include "Public/winget/Filesystem.h"
15
#include "DODownloader.h"
16
#include "HttpStream/HttpRandomAccessStream.h"
17
+#include "Public/winget/ThreadGlobals.h"
18
19
using namespace AppInstaller::Runtime;
20
using namespace AppInstaller::Settings;
@@ -547,8 +548,10 @@ namespace AppInstaller::Utility
547
548
549
HRESULT hr = S_OK;
550
- std::thread aesThread([&]()
551
+ ThreadLocalStorage::ThreadGlobals* globals = ThreadLocalStorage::ThreadGlobals::GetForCurrentThread();
552
+ std::thread aesThread([&, globals]()
553
{
554
+ auto globalsCleanup = globals ? globals->SetForCurrentThread() : nullptr;
555
try
556
557
hr = LOG_IF_FAILED(CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED));
0 commit comments