Skip to content

Commit a39e52d

Browse files
authored
Fix dxilconv crash when initialization fails (#3254)
1 parent 35fda69 commit a39e52d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/DxcSupport/dxcmem.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ IMalloc *DxcGetThreadMallocNoRef() throw() {
5858
}
5959

6060
void DxcClearThreadMalloc() throw() {
61-
IMalloc *pMalloc = DxcGetThreadMallocNoRef();
6261
if (g_ThreadMallocTls != nullptr) {
62+
IMalloc *pMalloc = DxcGetThreadMallocNoRef();
6363
g_ThreadMallocTls->erase();
64-
}
65-
if (pMalloc != nullptr) {
66-
pMalloc->Release();
64+
if (pMalloc != nullptr) {
65+
pMalloc->Release();
66+
}
6767
}
6868
}
6969

0 commit comments

Comments
 (0)