|
@@ -231,15 +231,15 @@ end;
|
|
|
|
|
|
procedure TCompressionHandler.EndChunk;
|
|
procedure TCompressionHandler.EndChunk;
|
|
begin
|
|
begin
|
|
- if Assigned(FCompressor) then begin
|
|
|
|
- FCompressor.Finish;
|
|
|
|
- { In case we didn't get a ProgressProc call after the final block: }
|
|
|
|
- FCompiler.SetBytesCompressedSoFar(FInitialBytesCompressedSoFar);
|
|
|
|
- FCompiler.AddBytesCompressedSoFar(FChunkBytesRead);
|
|
|
|
- FCompiler.CallIdleProc;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
|
|
+ if not FChunkStarted then
|
|
|
|
+ Exit;
|
|
FChunkStarted := False;
|
|
FChunkStarted := False;
|
|
|
|
+
|
|
|
|
+ FCompressor.Finish;
|
|
|
|
+ { In case we didn't get a ProgressProc call after the final block: }
|
|
|
|
+ FCompiler.SetBytesCompressedSoFar(FInitialBytesCompressedSoFar);
|
|
|
|
+ FCompiler.AddBytesCompressedSoFar(FChunkBytesRead);
|
|
|
|
+ FCompiler.CallIdleProc;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TCompressionHandler.CompressFile(const SourceFile: TFile;
|
|
procedure TCompressionHandler.CompressFile(const SourceFile: TFile;
|
|
@@ -315,4 +315,4 @@ begin
|
|
FCompiler.CallIdleProc;
|
|
FCompiler.CallIdleProc;
|
|
end;
|
|
end;
|
|
|
|
|
|
-end.
|
|
|
|
|
|
+end.
|