Преглед изворни кода

* 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 -

Jonas Maebe пре 14 година
родитељ
комит
66258fb0b8
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      compiler/cclasses.pas

+ 3 - 0
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;