Skip to content

Commit

Permalink
Fix memory leaks of debug name in a couple of tests (#5727)
Browse files Browse the repository at this point in the history
A few tests were calling CompileWithDebug, passing in pointer that gets
set to the debug name, but was never freed.
  • Loading branch information
amaiorano authored Sep 18, 2023
1 parent 549030f commit 7bd186f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/clang/unittests/HLSL/PixTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ TEST_F(PixTest, CompileDebugDisasmPDB) {
CComPtr<IDxcBlobEncoding> pSource;
CComPtr<IDxcBlob> pProgram;
CComPtr<IDxcBlob> pPdbBlob;
WCHAR *pDebugName = nullptr;
CComHeapPtr<WCHAR> pDebugName;

VERIFY_SUCCEEDED(CreateCompiler(&pCompiler));
VERIFY_SUCCEEDED(pCompiler.QueryInterface(&pCompiler2));
Expand Down Expand Up @@ -1316,7 +1316,7 @@ TEST_F(PixTest, CompileDebugPDB) {
CComPtr<IDxcBlobEncoding> pSource;
CComPtr<IDxcBlob> pProgram;
CComPtr<IDxcBlob> pPdbBlob;
WCHAR *pDebugName = nullptr;
CComHeapPtr<WCHAR> pDebugName;

VERIFY_SUCCEEDED(CreateCompiler(&pCompiler));
VERIFY_SUCCEEDED(pCompiler.QueryInterface(&pCompiler2));
Expand Down
2 changes: 1 addition & 1 deletion tools/clang/unittests/HLSLTestLib/FileCheckerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ static HRESULT CompileForHash(hlsl::options::DxcOpts &opts, LPCWSTR CommandFileN
CComPtr<IDxcBlob> pCompiledBlob;
CComPtr<IDxcBlob> pCompiledName;
CComPtr<IDxcIncludeHandler> pIncludeHandler;
WCHAR *pDebugName = nullptr;
CComHeapPtr<WCHAR> pDebugName;
CComPtr<IDxcBlob> pPDBBlob;

std::wstring entry =
Expand Down

0 comments on commit 7bd186f

Please sign in to comment.