Spelt/ZXing.Delphi

TDecoderResult.Destroy - ByteSegments should not be cleared

JedrzejczykRobert opened this issue · 0 comments

file: ZXing.DecoderResult;
lines: 79-81

code:

  if Assigned(ByteSegments)
  then
     ByteSegments.Clear;

should be removed, because Count is 0, after extracted from result meta, for example:

if rs.ResultMetaData.ContainsKey(TResultMetaDataType.BYTE_SEGMENTS)  then
begin
  obj := rs.ResultMetaData.Items[TResultMetaDataType.BYTE_SEGMENTS];
  if Supports(obj, IByteSegmentsMetadata, bytesMetadata) then
  begin
    bytesMetadata.Value.Count; // Count is 0
  end;
end;