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

Issue #129 resolved
Anonymous 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. 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.

  2. 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.

  3. 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)

  4. 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 ?

  5. 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.

  6. Log in to comment