IniPropStorage wipes configuration if collection is used
Original Reporter info from Mantis: luca @olivluca
-
Reporter name: Luca Olivetti
Original Reporter info from Mantis: luca @olivluca
- Reporter name: Luca Olivetti
Description:
Due to a faulty implementation of IsWild used in DoEraseSection (copied verbatim from strutils), all settings in the main section will be wiped if is there a collection in the SessionProperties of the form (e.g. a TMemo):
DoEraseSection('ajustes.Memo1_lines')
will wipe section 'ajustes' since IsWild('ajustes','ajustes.Memo1_lines.*',false) returns True.
This is a really nasty bug since it wipes the configuration file, introduced when bug #23644 (closed) (since the bug failed to implement DoEraseSection, but at least it kept the configuration file intact albeit with useless data).
Steps to reproduce:
Run the attached project, change value of the spinedit, push the button or close the project.
The value of the spinedit isn't saved in the ini file.
Additional information:
Note that this behaviour is dependent on the order of the SessionProperties (i.e., a value that comes after the last collection will be preserved, since it will be written again after wiping the main section).
Why is the IsWild needed? Wouldn't it be enough to just wipe the specified section?
And shouldn't the comparison be case insensitive?
Mantis conversion info:
- Mantis ID: 26112
- Version: 1.2.2
- Fixed in revision: r45077 (#e756eca7)
- Monitored by: » BigChimp (Reinier Olislagers)