[fpc-devel] problem with TStringLists and delete in glibc
Marco van de Voort
marcov at stack.nl
Sat Mar 16 15:37:14 CET 2013
In our previous episode, Stefan Fischer said:
> var IniFileDescriptor:T_IniFileDesc; name_idx:longint;
> ...
>
> with IniFileDescriptor do
> begin
> inifilbuf:=TStringList.create;
> for name_idx:= 1 to 220 inifilbuf.add('something');
> name_idx:=5;
> inifilbuf.insert (name_idx-1, 'someOTHERstring');
> inifilbuf.delete(name_idx); // <- this creates the glibc error
> end;
Please write inifilbuf.count after the for-loop.
Maybe tstringlist doesn't store dupes by default, and after the loop it only
contains one item.
More information about the fpc-devel
mailing list