* Fixed file handle leak when creating GUIDs

git-svn-id: trunk@11120 -
This commit is contained in:
michael 2008-05-29 12:41:22 +00:00
parent 971a28ece4
commit 48bf280781

View File

@ -61,14 +61,14 @@ begin
fd:=FileOpen(KernelUUID,fmOpenRead); fd:=FileOpen(KernelUUID,fmOpenRead);
Result:=(Fd>=0); Result:=(Fd>=0);
if Result then if Result then
begin try
SetLength(S,UUIDLen); SetLength(S,UUIDLen);
SetLength(S,FileRead(fd,S[1],UUIDLen)); SetLength(S,FileRead(fd,S[1],UUIDLen));
Result:=(Length(S)=UUIDLen); Result:=(Length(S)=UUIDLen);
If Result then If Result then
begin
GUID:=StringToGUID('{'+S+'}'); GUID:=StringToGUID('{'+S+'}');
//Writeln('Kernel ID = ',GuidToString(GUID)); finally
FileClose(FD);
end; end;
end; end;
end; end;