TChecklistbox - "Checked" property triggers crash when adding Objects
Original Reporter info from Mantis: Hansaplast
-
Reporter name: Hans Luijten
Original Reporter info from Mantis: Hansaplast
- Reporter name: Hans Luijten
Description:
After adding objects to a TChecklistbox (using CheckListBox1.AddItem or CheckListBox1.Items.AddObject), reading or assigning a value to the "Checked[]" property will crash the application with (SYSTEM_
TOBJECT___
$_INHERITSFROMTCLASS
$BOOLEAN).
I suspect that the checkbox boolean value is stored in the object property - but I could be very wrong.
Under Windows and Linux (GTK), this does not happen and the TChecklistbox works as expected.
Steps to reproduce:
See also attached test project.
Create empty form, add TCheclistbox, a button and a label.
Define a class for testing to be attached to the listbox items.
Onclick button: add item with new object to the list and set the value for "checked[x]" to "true".
Onclick checlistbox: retrieve value stored in custom class and display it.
Add item with object works, however; assign the value "true" to "checked" will crash.
The newly added item will always be checked, but when reading the value it will return "false".
If not assigning anything to checked at the point of adding; item is right away checked, user can uncheck, but checking the item again will crash the app again.
Additional information:
Lazarus 2.1.0 r59632M FPC 3.0.4 x86_64-darwin-cocoa (alpha)
Also posted in the forum:
https://forum.lazarus.freepascal.org/index.php/topic,43284.0.html
Mantis conversion info:
- Mantis ID: 34590
- OS: macOS
- OS Build: 10.14
- Build: r59632M
- Platform: Mac
- Version: 2.1 (SVN)
- Fixed in revision: 59645 (#f3a0a55e)
- Monitored by: » Hansaplast (Hans Luijten)