Ignore:
Timestamp:
Nov 19, 2012, 2:47:07 PM (12 years ago)
Author:
chronos
Message:
  • Fixed: Wrong memory inicialization in TListObject results in error during other object assignment.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Additional/UBinarySerializer.pas

    r410 r441  
    2525    Position: Integer;
    2626    OwnsList: Boolean;
    27     procedure Write(var Buffer; Count: Integer); inline;
    28     procedure Read(var Buffer; Count: Integer); inline;
     27    procedure Write(var Buffer; Count: Integer); //inline;
     28    procedure Read(var Buffer; Count: Integer); //inline;
    2929
    3030    procedure Assign(Source: TBinarySerializer);
     
    7373  StringLength: Longint;
    7474begin
    75   FList.ReadBuffer(StringLength, SizeOf(StringLength));
     75  StringLength := 0;
     76  Read(StringLength, SizeOf(StringLength));
    7677  Result := ReadString(StringLength);
    7778end;
     
    102103function TBinarySerializer.ReadByte: Byte;
    103104begin
     105  Result := 0;
    104106  Read(Result, SizeOf(Byte));
    105107end;
     
    107109function TBinarySerializer.ReadCardinal: Cardinal;
    108110begin
     111  Result := 0;
    109112  Read(Result, SizeOf(Cardinal));
    110113  if SwapData then Result := SwapEndian(Result);
     
    113116function TBinarySerializer.ReadInt64: Int64;
    114117begin
     118  Result := 0;
    115119  Read(Result, SizeOf(Int64));
    116120  if SwapData then Result := SwapEndian(Result);
     
    129133  Count: Byte;
    130134begin
     135  Count := 0;
    131136  Read(Count, 1);
    132137  Result := ReadString(Count);
     
    223228function TBinarySerializer.ReadDouble: Double;
    224229begin
     230  Result := 0;
    225231  Read(Result, SizeOf(Double));
    226232end;
     
    228234function TBinarySerializer.ReadSingle: Single;
    229235begin
     236  Result := 0;
    230237  Read(Result, SizeOf(Single));
    231238end;
     
    233240function TBinarySerializer.ReadWord: Word;
    234241begin
     242  Result := 0;
    235243  Read(Result, SizeOf(Word));
    236244  if SwapData then Result := SwapEndian(Result);
Note: See TracChangeset for help on using the changeset viewer.