summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-08 08:10:07 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-08 08:10:07 +0000
commite365d82c6e9ca1261ee3357612308294b691d1f2 (patch)
tree2b3f0af55ad7afaee7b203af5d65335902cff4a7
parentc7214f448a508a4c753d948bce249174fa534ac4 (diff)
downloadfpc-e365d82c6e9ca1261ee3357612308294b691d1f2.tar.gz
* 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: http://svn.freepascal.org/svn/fpc/trunk@17270 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/cclasses.pas3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/cclasses.pas b/compiler/cclasses.pas
index d568f33d31..9eb8f7159a 100644
--- a/compiler/cclasses.pas
+++ b/compiler/cclasses.pas
@@ -2208,6 +2208,9 @@ end;
function TCmdStrListItem.GetCopy:TLinkedListItem;
begin
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;
end;