Ignore:
Timestamp:
Dec 23, 2010, 9:50:33 AM (14 years ago)
Author:
george
Message:
  • Fixed: String type is reference counter thus have to be properly cleared in similar fashion to objects. Problem is caused by use of System.Move procedure where instance of strings are not reference count decremented. Introduced generic class TGListString which is used for common TListString class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Generics/TemplateGenerics/Specialized/SpecializedList.pas

    r92 r101  
    5252
    5353// TListString<Integer, string>
    54 {$DEFINE TGListIndex := Integer}
    55 {$DEFINE TGListItem := string}
    56 {$DEFINE TGList := TListString}
    57 {$DEFINE TGListSortCompare := TListStringSortCompare}
    58 {$DEFINE TGListToStringConverter := TListStringToStringConverter}
    59 {$DEFINE TGListFromStringConverter := TListStringFromStringConverter}
    60 {$DEFINE INTERFACE}
    61 {$I 'GenericList.inc'}
     54{$DEFINE TGListStringIndex := Integer}
     55{$DEFINE TGListStringItem := string}
     56{$DEFINE TGListString := TListString}
     57{$DEFINE TGListStringSortCompare := TListStringSortCompare}
     58{$DEFINE TGListStringToStringConverter := TListStringToStringConverter}
     59{$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}
     60{$DEFINE INTERFACE}
     61{$I 'GenericListString.inc'}
    6262
    6363// TListByte<Integer, Byte>
     
    8080{$DEFINE INTERFACE}
    8181{$I 'GenericList.inc'}
     82
     83// TListObject<Integer, TObject>
     84{$DEFINE TGListObjectIndex := Integer}
     85{$DEFINE TGListObjectItem := TObject}
     86{$DEFINE TGListObjectList := TObjectListListObject}
     87{$DEFINE TGListObject := TListObject}
     88{$DEFINE TGListObjectSortCompare := TObjectListSortCompareObject}
     89{$DEFINE TGListObjectToStringConverter := TObjectListToStringConverterObject}
     90{$DEFINE TGListObjectFromStringConverter := TObjectListFromStringConverterObject}
     91{$DEFINE INTERFACE}
     92{$I 'GenericListObject.inc'}
     93
    8294
    8395{ TListChar }
     
    140152
    141153// TListString<Integer, string>
    142 {$DEFINE TGListIndex := Integer}
    143 {$DEFINE TGListItem := string}
    144 {$DEFINE TGList := TListString}
    145 {$DEFINE TGListSortCompare := TListStringSortCompare}
    146 {$DEFINE TGListToStringConverter := TListStringToStringConverter}
    147 {$DEFINE TGListFromStringConverter := TListStringFromStringConverter}
    148 {$DEFINE IMPLEMENTATION}
    149 {$I 'GenericList.inc'}
     154{$DEFINE TGListStringIndex := Integer}
     155{$DEFINE TGListStringItem := string}
     156{$DEFINE TGListString := TListString}
     157{$DEFINE TGListStringSortCompare := TListStringSortCompare}
     158{$DEFINE TGListStringToStringConverter := TListStringToStringConverter}
     159{$DEFINE TGListStringFromStringConverter := TListStringFromStringConverter}
     160{$DEFINE IMPLEMENTATION}
     161{$I 'GenericListString.inc'}
    150162
    151163// TListByte<Integer, Byte>
     
    169181{$I 'GenericList.inc'}
    170182
     183// TListObject<Integer, TObject>
     184{$DEFINE TGListObjectIndex := Integer}
     185{$DEFINE TGListObjectItem := TObject}
     186{$DEFINE TGListObjectList := TObjectListListObject}
     187{$DEFINE TGListObject := TListObject}
     188{$DEFINE TGListObjectSortCompare := TObjectListSortCompareObject}
     189{$DEFINE TGListObjectToStringConverter := TObjectListToStringConverterObject}
     190{$DEFINE TGListObjectFromStringConverter := TObjectListFromStringConverterObject}
     191{$DEFINE IMPLEMENTATION}
     192{$I 'GenericListObject.inc'}
     193
     194
    171195
    172196function StrToStr(Value: string): string;
Note: See TracChangeset for help on using the changeset viewer.