File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -426,9 +426,7 @@ procedure TRALParam.SetAsStream(const AValue: TStream);
426426 AValue.Position := 0 ;
427427 FContent := TRALStringStream.Create(AValue);
428428 FContent.Position := 0 ;
429- end
430- else
431- FContent := nil ;
429+ end ;
432430end ;
433431
434432procedure TRALParam.SetAsString (const AValue: StringRAL);
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ interface
1515
1616 TRALBinaryWriter = class
1717 private
18- FStream : TStream;
18+ FStream: TStream;
1919 protected
2020 // read and write UTF-7
2121 function ReadSize : UInt64RAL;
@@ -158,7 +158,11 @@ function StreamToString(AStream: TStream): StringRAL;
158158 else
159159 begin
160160 vStream := TRALStringStream.Create(AStream);
161- Result := TRALStringStream(vStream).DataString;
161+ try
162+ Result := TRALStringStream(vStream).DataString;
163+ finally
164+ FreeAndNil(vStream);
165+ end ;
162166
163167// vStream := TStringStream.Create(EmptyStr);
164168// try
You can’t perform that action at this time.
0 commit comments