From: DeaDDooMER Date: Fri, 5 Oct 2018 20:05:40 +0000 (+0300) Subject: Fix locks again X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=01c9a29799525526658398f627b8be9f8f11e903;p=d2df-editor.git Fix locks again --- diff --git a/src/editor/g_resources.pas b/src/editor/g_resources.pas index 89b242a..efed125 100644 --- a/src/editor/g_resources.pas +++ b/src/editor/g_resources.pas @@ -7,7 +7,7 @@ interface implementation - uses sfs, xstreams, utils, Classes; + uses sfs, utils, Classes; procedure g_ReadResource (wad, section, name: String; out data: PByte; out len: Integer); var @@ -33,14 +33,14 @@ implementation stream.Destroy end end; + SFSGCCollect end; procedure g_ReadSubResource (wad, section0, name0, section1, name1: String; out data: PByte; out len: Integer); var stream0, stream1: TStream; str0, str1: String; - xdata: Pointer; - i, xlen: Integer; + i: Integer; begin data := nil; len := 0; @@ -58,7 +58,7 @@ implementation if SFSAddSubDataFile(wad + '\' + str0, stream0, TRUE) then begin str1 := SFSGetLastVirtualName(section1 + '\' + name1); - stream1 := SFSFileOpenEx(wad + '\' + str0 + '::' + str1); + stream1 := SFSFileOpen(wad + '\' + str0 + '::' + str1); if stream1 <> nil then begin len := stream1.Size; @@ -74,7 +74,8 @@ implementation begin stream0.Destroy end - end + end; + SFSGCCollect end; end. diff --git a/src/sfs/sfs.pas b/src/sfs/sfs.pas index 67136e9..c3c7410 100644 --- a/src/sfs/sfs.pas +++ b/src/sfs/sfs.pas @@ -456,8 +456,7 @@ begin while f < volumes.Count do begin vi := TVolumeInfo(volumes[f]); - if vi = nil then continue; - if (not vi.fPermanent) and (vi.fOpenedFilesCount = 0) then + if (vi <> nil) and (not vi.fPermanent) and (vi.fOpenedFilesCount = 0) then begin // this volume probably can be removed used := false;