[Patch] TDBLookup.Initialize causes sigsegv when ListLink.Dataset is closed and DefaultFields true
Original Reporter info from Mantis: ludob
-
Reporter name: Ludo Brands
Original Reporter info from Mantis: ludob
- Reporter name: Ludo Brands
Description:
Zeosdataset frees TDataset.Fields when the dataset is closed and DefaultFields=true. TDBLookup.Initialize opens temporarily a closed link dataset stores FListField and closes it again before calling FetchLookupData. FetchLookupData reopens the link dataset and calls then FListField.DisplayText on a FListField that points to a freed TField from the first open. This results in a sigsegv.
The patch fetches FListField in the beginning of FetchLookupData to be sure the FListField is current. I also does this after LinkGetBookMark to avoid opening twice the dataset temporarily.
An alternative, more complex, patch would be to invalidate FListField when the link dataset is closed and only re-fetch FListField when invalidated.
Mantis conversion info:
- Mantis ID: 22387
- Version: 1.1 (SVN)