+ RelocateHeap: tolerate being called more than once.

git-svn-id: trunk@17762 -
This commit is contained in:
sergei 2011-06-16 18:57:36 +00:00
parent 3cdbe30c28
commit 3e145f6d77

View File

@ -1507,11 +1507,13 @@ var
loc_freelists: pfreelists;
begin
{ this function should be called in main thread context }
loc_freelists := @freelists;
{$ifdef FPC_HAS_FEATURE_THREADING}
if heap_lock_use > 0 then
exit;
heap_lock_use := 1;
initcriticalsection(heap_lock);
{$endif}
loc_freelists := @freelists;
{ loc_freelists still points to main thread's freelists, but they
have a reference to the global main freelists, fix them to point
to the main thread specific variable }