Skip to content

Commit 2b978f1

Browse files
committed
[1.11>master] [MERGE #5961 @MikeHolman] fix bug causing win7 pdata not to get cleaned up
Merge pull request #5961 from MikeHolman:win7pdata
2 parents 96c69fc + 02c0cbc commit 2b978f1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/Backend/NativeEntryPointData.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,17 @@ NativeEntryPointData::CleanupXDataInfo()
323323
{
324324
XDataAllocator::Unregister(this->xdataInfo);
325325
#ifdef _WIN32
326-
if (this->xdataInfo->functionTable
327-
&& !DelayDeletingFunctionTable::AddEntry(this->xdataInfo))
326+
if (AutoSystemInfo::Data.IsWin8OrLater())
328327
{
329-
DelayDeletingFunctionTable::DeleteFunctionTable(this->xdataInfo);
328+
// transfers ownership of xdataInfo object
329+
if(!DelayDeletingFunctionTable::AddEntry(this->xdataInfo))
330+
{
331+
DelayDeletingFunctionTable::DeleteFunctionTable(this->xdataInfo);
332+
}
333+
}
334+
else
335+
{
336+
HeapDelete(this->xdataInfo);
330337
}
331338
#endif
332339
this->xdataInfo = nullptr;

0 commit comments

Comments
 (0)