Anonymous | Login | Signup for a new account | 2019-02-20 01:14 CET |
Main | My View | View Issues | Change Log | Roadmap | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||
0003570 | [JEDI VCL] 00 JVCL Components | crash | always | 2006-03-09 15:05 | 2006-03-10 02:48 | ||
Reporter | Kiriakos | View Status | public | ||||
Assigned To | AHUser | ||||||
Priority | normal | Resolution | fixed | ||||
Status | resolved | Product Version | |||||
Summary | 0003570: AppStorage bug when reading nested object lists in v3.2 | ||||||
Description |
The problem is in the following function. TargetStore.FCurrentInstanceCreateEvent is set to nil on exit which means that if this call made from an outer ReadObjectList call when the outer call will crash making a call to function which is set to nil. function TJvCustomAppStorage.ReadObjectList(const Path: string; List: TList; ItemCreator: TJvAppStorageObjectListItemCreateEvent; const ClearFirst: Boolean = True; const ItemName: string = cItem): Integer; var TargetStore: TJvCustomAppStorage; TargetPath: string; begin if not ListStored(Path) and StorageOptions.DefaultIfValueNotExists then Result := List.Count else begin if ClearFirst then List.Clear; ResolvePath(Path + cSubStorePath, TargetStore, TargetPath); // Only needed for assigning the event TargetStore.FCurrentInstanceCreateEvent := ItemCreator; Result := ReadList(Path, List, ReadObjectListItem, ItemName); TargetStore.FCurrentInstanceCreateEvent := nil; end; end; |
||||||
Additional Information |
Solution. Change the above method to: function TJvCustomAppStorage.ReadObjectList(const Path: string; List: TList; ItemCreator: TJvAppStorageObjectListItemCreateEvent; const ClearFirst: Boolean = True; const ItemName: string = cItem): Integer; var FOldInstanceCreateEvent: TJvAppStorageObjectListItemCreateEvent; TargetStore: TJvCustomAppStorage; TargetPath: string; begin if not ListStored(Path) and StorageOptions.DefaultIfValueNotExists then Result := List.Count else begin if ClearFirst then List.Clear; ResolvePath(Path + cSubStorePath, TargetStore, TargetPath); // Only needed for assigning the event FOldInstanceCreateEvent := TargetStore.FCurrentInstanceCreateEvent; TargetStore.FCurrentInstanceCreateEvent := ItemCreator; Result := ReadList(Path, List, ReadObjectListItem, ItemName); TargetStore.FCurrentInstanceCreateEvent := FOldInstanceCreateEvent; end; end; |
||||||
Tags | No tags attached. | ||||||
Attached Files | |||||||
|
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |