TStringList.Move

2012-07-18
2012-11-16
  • Hello,
    I've noticed that the TStrings.Move is implemented as:
    Obj:=Objects;
    Str:=Strings;
    Delete(Curindex);
    InsertObject(NewIndex,Str,Obj);
    which is OK until you set OwnsObjects to True, because than the
    TStringList.Delete will Free the object. If this is expected behaviour, add
    please notice to the TStrings.Move documentation.

     
  • Tomas Hajny
    Tomas Hajny
    2012-11-16

    Thanks for the feedback. I personally cannot judge the topic / answer your question, but I suggest posting the documentation request as suggestion to our bug repository (http://bugs.freepascal.org) so it can be tracked as appropriate.

     
    • Chad Granum
      Chad Granum
      2012-11-16

      Your email to Cor'e was automatically blocked as SPAM because correspondence with Cor'e requires his SPAM Key to be placed in the email body or Subject line.

      SPAM Key: =)

       
  • It should not free the object. I've applied a fix, revision 22992.