summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 24d173d)
raw | patch | inline | side by side (parent: 24d173d)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 20 Feb 2019 19:51:20 +0000 (22:51 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 20 Feb 2019 19:51:20 +0000 (22:51 +0300) |
src/editor/g_resources.pas | patch | blob | history |
index cc8e0a8ef717d655553178b73256c88abbe8bf81..bcb7da293ab8dfda54a19c0c3142d53e657302d7 100644 (file)
procedure g_DeleteFile (wad: String; backupPostfix: String = '.bak');
var newwad: String;
begin
+ SFSGCCollect;
+ SFSGCCollect;
+ SFSGCCollect;
if Backup then
begin
if FileExists(wad) then
begin
newwad := wad + backupPostfix;
if FileExists(newwad) then
- ASSERT(DeleteFile(newwad));
- ASSERT(RenameFile(wad, newwad))
+ ASSERT(DeleteFile(newwad), 'Can''t delete file ' + newwad);
+ ASSERT(RenameFile(wad, newwad), 'Can''t rename file ' + wad + ' -> ' + newwad)
end
end
else
begin
if FileExists(wad) then
- ASSERT(DeleteFile(wad))
+ ASSERT(DeleteFile(wad), 'Can''t delete file ' + newwad)
end
end;
ts.Free;
g_DeleteFile(wad);
- ASSERT(RenameFile(tmp, wad));
+ ASSERT(RenameFile(tmp, wad), 'Can''t rename file ' + tmp + ' -> ' + wad);
res := 0
end;
ts.Free;
g_DeleteFile(wad);
- ASSERT(RenameFile(tmp, wad));
+ ASSERT(RenameFile(tmp, wad), 'Can''t rename file ' + tmp + ' -> ' + wad);
res := 0
end;
for i := 0 to len - 1 do
data[i] := stream1.ReadByte();
stream1.Destroy
+ //stream0.Destroy (* leads to memory corruption, it destroyed with stream1? *)
+ end
+ else
+ begin
+ stream0.Destroy
end
end
- end
- else
- begin
- stream0.Destroy
+ else
+ begin
+ stream0.Destroy
+ end
end
end;
SFSGCCollect