Gute Morgen,
.. mhm irgendwie komme ich nicht so recht weiter.
Delphi-Quellcode:
procedure TshowTraces.FormCreate(Sender: TObject);
var
headerLine : TStringList;
mStream : TMemoryStream;
begin
errorLog := TLogger.getInstance;
traceMessageList := TTraceMessageList.getInstance;
caption := 'show trace '+extractFileName(traceFileName);
mStream := TMemoryStream.Create;
decoder := TDecodeTrace.create;
try
mStream.LoadFromFile(traceFileName);
decoder.addTrace(mStream);
finally
freeAndNil(mStream);
end;
end;
Delphi-Quellcode:
procedure TshowTraces.FormClose(Sender: TObject; var Action: TCloseAction);
begin
output.Enabled := false;
if assigned(decoder) then
decoder.terminate;
freeAndNil(traceMessageList);
end;
Delphi-Quellcode:
constructor TDecodeTrace.create;
begin
inherited create(true);
freeOnTerminate := true;
mStream := TMemoryStream.Create;
errorLog := TLogger.getInstance;
protMessages := TProtMessages.getInstance;
end;
Delphi-Quellcode:
procedure TDecodeTrace.addTrace(traceStream: TMemoryStream);
var
streamPosition : Int64;
begin
if not suspended then
suspend;
streamPosition := mStream.Position;
mStream.Seek(0,soFromEnd);
traceStream.saveToStream(mStream);
mStream.Seek(streamPosition,soFromBeginning);
resume;
end;
Delphi-Quellcode:
destructor TDecodeTrace.Destroy;
begin
if assigned(mstream) then
freeAndNil(mStream);
sleep(200);
inherited destroy;
freeAndNil(protMessages);
end;
Ich sehe hier nicht unbedingt das etwas falsch freigegeben oder auch unerlaubt wieder benutzt wird.
Grüße
Klaus