Listbox.items[index] := 'SomeStrContent'; crashes the app

Issue #129 resolved
Former user created an issue

The assignment of

Listbox.items[index] := 'Stringcontent';

crashes the app.

ErrorMessage is "ListItems out of bounds".

In this concret Szenario the Listbox has one entry and index is Zero.

Comments (15)

  1. Eugene Kryukov repo owner

    Again, what version of CrossVcl ? Try to uninstall/install latest one. 0.99a works good in your case

  2. Harry Stahl

    Yes, it was 0.99a.

    But strange, with a new form it works, but not with an existing.

    With Debugging I can step to unit Vcl.stdctrls, in

    procedure TListBoxstrings.delete (Index:Integer) ListBox.Deletestring(index), // Here it crashes end;

    it crashes then.

  3. Eugene Kryukov repo owner

    We added code which is print CrossVcl runtime version in PAServer at 0.99b. It looks like your application still use old version. Please check new version and confirm if you notice correct CrossVcl version.

  4. Harry Stahl

    I've installed Version .99b (Version-Code is shown in PAServer), but same issue, but only especially with this one app.

    I've found out more details, perhaps it will help you. The error only occurs, when the LAST ITEM in the listbox is affected. Setting the last item (eg listbox.items[0] := 'Test' with one items) or deleting the last item has always a deleting call (ListBox.Deletestring(index), and that crash the app.

    But as I mentioned, when I use it in an other app, all works as expected. Strange Thing! If you have no idea, so leave it alone, perhaps I'm the only person with that problem and I can make a programmatical workaraound to work not on the last item.

    An other bug (also in new created Project) I found: ListBox1.items.clear; has no effect (mac and Linux)

  5. Harry Stahl

    Unfortunatelly not. On a new Project it works, but not on an old one. Attached you find the Project-file, perhaps you can see something irregular issues.

  6. Eugene Kryukov repo owner

    I didn't found any issue with project file. I've added ListBox unit from test project and it works the same. Can you post here TListBox property values from DFM ?

  7. Harry Stahl

    I have made an excerpt of the app (two forms, the main form and the user rights form, no additional units are needed) and send you the files (the reduced Project) als zipfile to support@crossvcl.com. In the mail you'll find instructions to reproduce the error.

    On Linux it crashes also when you try to add an item to the listbox. But strange, as I said, this problems are not in a new created project. I hope it helps.

  8. Log in to comment