* fixed TCmdStrListItem.GetCopy() (the reference count of the ansistring

field was messed up due to the use of "move()" to copy all field data)

git-svn-id: trunk@17270 -
This commit is contained in:
Jonas Maebe 2011-04-08 08:10:07 +00:00
parent 03ca42d6e2
commit 66258fb0b8

View File

@ -2208,6 +2208,9 @@ end;
function TCmdStrListItem.GetCopy:TLinkedListItem; function TCmdStrListItem.GetCopy:TLinkedListItem;
begin begin
Result:=(inherited GetCopy); Result:=(inherited GetCopy);
{ TLinkedListItem.GetCopy performs a "move" to copy all data -> reinit
the ansistring, so the refcount is properly increased }
Initialize(TCmdStrListItem(Result).FPStr);
TCmdStrListItem(Result).FPStr:=FPstr; TCmdStrListItem(Result).FPStr:=FPstr;
end; end;