Fixed MemoryStream Issue

This commit is contained in:
Benjamin Rosseaux 2026-07-01 04:23:22 +02:00
commit 7acff75b48

View file

@ -14934,6 +14934,8 @@ begin
result:=TFileStream(aStream).Flush;
end else if aStream is TPasRISCVFileMappedStream then begin
result:=TPasRISCVFileMappedStream(aStream).Flush;
end else if aStream is TCustomMemoryStream then begin
result:=true; // A purely in-memory stream has nothing to flush, so this trivially succeeds.
end else begin
result:=false;
end;
@ -14948,6 +14950,8 @@ begin
result:=FlushFileBuffers(TFileStream(aStream).Handle);
end else if aStream is TPasRISCVFileMappedStream then begin
result:=TPasRISCVFileMappedStream(aStream).Flush;
end else if aStream is TCustomMemoryStream then begin
result:=true; // A purely in-memory stream has nothing to flush, so this trivially succeeds.
end else begin
result:=false;
end;
@ -14960,6 +14964,8 @@ begin
if assigned(aStream) then begin
if aStream is TPasRISCVFileMappedStream then begin
result:=TPasRISCVFileMappedStream(aStream).Flush;
end else if aStream is TCustomMemoryStream then begin
result:=true; // A purely in-memory stream has nothing to flush, so this trivially succeeds.
end else begin
result:=false;
end;