Explorar o código

* GetRandomBytes calls randomize only once, now thread safe too

git-svn-id: trunk@11125 -
michael %!s(int64=17) %!d(string=hai) anos
pai
achega
d419c1078a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      rtl/objpas/sysutils/sysutils.inc

+ 1 - 1
rtl/objpas/sysutils/sysutils.inc

@@ -582,8 +582,8 @@ begin
   P:=@Buf;
   If Not GUIDCalledRandomize then
     begin
-    GUIDCalledRandomize:=True;
     Randomize;
+    GUIDCalledRandomize:=True;
     end;
   For I:=0 to NBytes-1 do
     P[i]:=Random(256);