Skip to content

Commit d51b933

Browse files
authored
Allocator fixes, sln build configuration fixes (#799)
* Fix some stray allocations that weren't properly using the custom allocators * Fix .sln build configuration so that GDK projects aren't set to build when Platform=x86/x64 and vice versa
1 parent 19640c5 commit d51b933

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

Source/Platform/GDK/PlatformComponents_GDK.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ HRESULT PlatformInitialize(PlatformComponents& components, HCInitArgs* initArgs)
2121
auto initWinHttpResult = WinHttpProvider::Initialize();
2222
RETURN_IF_FAILED(initWinHttpResult.hr);
2323

24-
components.WebSocketProvider = http_allocate_unique<WinHttp_WebSocketProvider>(initWinHttpResult.ExtractPayload());
24+
auto winHttpProvider = initWinHttpResult.ExtractPayload();
25+
components.WebSocketProvider = http_allocate_unique<WinHttp_WebSocketProvider>(SharedPtr<WinHttpProvider>{ winHttpProvider.release(), std::move(winHttpProvider.get_deleter()), http_stl_allocator<WinHttpProvider>{} });
2526
#endif
2627

2728
return S_OK;

Source/Platform/Win32/PlatformComponents_Win32.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ HRESULT PlatformInitialize(PlatformComponents& components, HCInitArgs* initArgs)
1313
auto initWinHttpResult = WinHttpProvider::Initialize();
1414
RETURN_IF_FAILED(initWinHttpResult.hr);
1515

16-
std::shared_ptr<WinHttpProvider> sharedProvider{ initWinHttpResult.ExtractPayload() };
16+
auto winHttpProvider = initWinHttpResult.ExtractPayload();
17+
std::shared_ptr<WinHttpProvider> sharedProvider{ winHttpProvider.release(), std::move(winHttpProvider.get_deleter()), http_stl_allocator<WinHttpProvider>{} };
1718

1819
components.HttpProvider = http_allocate_unique<WinHttp_HttpProvider>(sharedProvider);
1920
#if !HC_NOWEBSOCKETS

libHttpClient.vs2022.sln

-7
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ Global
179179
{2DFBBF3A-6D4B-4FF8-BD01-C9527A1FE0AC}.Debug|ARM64.Build.0 = Debug|ARM64
180180
{2DFBBF3A-6D4B-4FF8-BD01-C9527A1FE0AC}.Debug|ARM64.Deploy.0 = Debug|ARM64
181181
{2DFBBF3A-6D4B-4FF8-BD01-C9527A1FE0AC}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|x64
182-
{2DFBBF3A-6D4B-4FF8-BD01-C9527A1FE0AC}.Debug|Gaming.Desktop.x64.Build.0 = Debug|x64
183182
{2DFBBF3A-6D4B-4FF8-BD01-C9527A1FE0AC}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|x64
184183
{2DFBBF3A-6D4B-4FF8-BD01-C9527A1FE0AC}.Debug|x64.ActiveCfg = Debug|x64
185184
{2DFBBF3A-6D4B-4FF8-BD01-C9527A1FE0AC}.Debug|x64.Build.0 = Debug|x64
@@ -324,7 +323,6 @@ Global
324323
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Debug|ARM64.ActiveCfg = Debug|ARM64
325324
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Debug|ARM64.Build.0 = Debug|ARM64
326325
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|x64
327-
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Debug|Gaming.Desktop.x64.Build.0 = Debug|x64
328326
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Debug|x64.ActiveCfg = Debug|x64
329327
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Debug|x64.Build.0 = Debug|x64
330328
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Debug|x86.ActiveCfg = Debug|Win32
@@ -334,7 +332,6 @@ Global
334332
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Release|ARM64.ActiveCfg = Release|ARM64
335333
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Release|ARM64.Build.0 = Release|ARM64
336334
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Release|Gaming.Desktop.x64.ActiveCfg = Release|x64
337-
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Release|Gaming.Desktop.x64.Build.0 = Release|x64
338335
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Release|x64.ActiveCfg = Release|x64
339336
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Release|x64.Build.0 = Release|x64
340337
{E35BA8A1-AE7B-4FB5-8200-469B98BC1CA8}.Release|x86.ActiveCfg = Release|Win32
@@ -346,19 +343,15 @@ Global
346343
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
347344
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
348345
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x64.ActiveCfg = Debug|Gaming.Desktop.x64
349-
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x64.Build.0 = Debug|Gaming.Desktop.x64
350346
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x86.ActiveCfg = Debug|Gaming.Desktop.x64
351-
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x86.Build.0 = Debug|Gaming.Desktop.x64
352347
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|ARM.ActiveCfg = Release|Gaming.Desktop.x64
353348
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|ARM.Build.0 = Release|Gaming.Desktop.x64
354349
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|ARM64.ActiveCfg = Release|Gaming.Desktop.x64
355350
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|ARM64.Build.0 = Release|Gaming.Desktop.x64
356351
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
357352
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
358353
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|x64.ActiveCfg = Release|Gaming.Desktop.x64
359-
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|x64.Build.0 = Release|Gaming.Desktop.x64
360354
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|x86.ActiveCfg = Release|Gaming.Desktop.x64
361-
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|x86.Build.0 = Release|Gaming.Desktop.x64
362355
EndGlobalSection
363356
GlobalSection(SolutionProperties) = preSolution
364357
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)