summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb34967)
raw | patch | inline | side by side (parent: fb34967)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 5 Oct 2018 20:05:40 +0000 (23:05 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 5 Oct 2018 20:05:40 +0000 (23:05 +0300) |
src/editor/g_resources.pas | patch | blob | history | |
src/sfs/sfs.pas | patch | blob | history |
index 89b242a5958dd719999dc26328a5cba00dd06d2d..efed1250499e8047dadb1a04f18988219a47be32 100644 (file)
implementation
- uses sfs, xstreams, utils, Classes;
+ uses sfs, utils, Classes;
procedure g_ReadResource (wad, section, name: String; out data: PByte; out len: Integer);
var
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;
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;
begin
stream0.Destroy
end
- end
+ end;
+ SFSGCCollect
end;
end.
diff --git a/src/sfs/sfs.pas b/src/sfs/sfs.pas
index 67136e9ab0c96e900accb49a8635ba56582f1768..c3c74104eea81ca00bcd9e0004125e7f86272072 100644 (file)
--- a/src/sfs/sfs.pas
+++ b/src/sfs/sfs.pas
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;