Преглед изворни кода

rtl/heap: while dealing with orphans, do not call FlushToFree if toFree is nil. this fixes a crash while exiting on MorphOS/PowerPC with threading enabled

Karoly Balogh пре 1 недеља
родитељ
комит
daa27044ec
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      rtl/inc/heap.inc

+ 2 - 1
rtl/inc/heap.inc

@@ -1657,7 +1657,8 @@ type
   begin
     if gs.lockUse <> 0 then
       EnterCriticalSection(HeapInc.gs.lock);
-    FlushToFree; { Performing it under gs.lock guarantees there will be no new toFree requests. }
+    if assigned(toFree) then
+      FlushToFree; { Performing it under gs.lock guarantees there will be no new toFree requests. }
     FreeEmptyArenas; { Has to free all empty arenas, otherwise the chunk that contains only empty arenas can leak. }
 
 {$if not defined(HAS_SYSOSFREE)}