Ver código fonte

fix bug that was causing win7 pdata not to get cleaned up

Michael Holman 7 anos atrás
pai
commit
9089e9afbb
1 arquivos alterados com 10 adições e 3 exclusões
  1. 10 3
      lib/Backend/NativeEntryPointData.cpp

+ 10 - 3
lib/Backend/NativeEntryPointData.cpp

@@ -323,10 +323,17 @@ NativeEntryPointData::CleanupXDataInfo()
     {
         XDataAllocator::Unregister(this->xdataInfo);
 #ifdef _WIN32
-        if (this->xdataInfo->functionTable
-            && !DelayDeletingFunctionTable::AddEntry(this->xdataInfo))
+        if (AutoSystemInfo::Data.IsWin8OrLater())
         {
-            DelayDeletingFunctionTable::DeleteFunctionTable(this->xdataInfo);
+            // transfers ownership of xdataInfo object
+            if(!DelayDeletingFunctionTable::AddEntry(this->xdataInfo))
+            {
+                DelayDeletingFunctionTable::DeleteFunctionTable(this->xdataInfo);
+            }
+        }
+        else
+        {
+            HeapDelete(this->xdataInfo);
         }
 #endif
         this->xdataInfo = nullptr;