Access Violation after closing a dataset in the IDE
Original Reporter info from Mantis: pgimeno
-
Reporter name: Pedro Gimeno
Original Reporter info from Mantis: pgimeno
- Reporter name: Pedro Gimeno
Description:
I get an Access Violation after removing FieldDefs that have associated Fields.
This problem is not always reproducible, but tends to happen quite often.
Steps to reproduce:
- Create a sqlite3 database with e.g. sqlite3 /tmp/database.sqlite "CREATE TABLE T(F INTEGER);"
- Add a TSQLite3Connection, point the DatabaseName to the above file.
2a (optional). Disable sofCreate in OpenFlags to ensure that the file you're opening is the one created in step 1.
- Add a TSQLTransaction, set the Database to the connection.
- Add a TSQLQuery, set the Database to the connection, set the SQL property to: 'SELECT * FROM T'
- Open the SQLQuery (check Active).
Note: After step 5, the FieldDefs are auto-filled but the Property Editor still says "0 items". That's a separate issue.
- Right click the SQLQuery, select "Edit fields" and add the only field available.
- Open the FieldDefs and remove the only FieldDef present.
- Go to the connection, set Connected to False to close both the connection and the SQLQuery.
After step 8, an Access Violation message is shown. If it is not, try setting Connected back to true, or click the SQLQuery.
Additional information:
Further fiddling with the components in this state often crashes the IDE.
I think I've had problems with this even when not deleting the FieldDefs before the Fields.
Lazarus 1.8.4 is the previous one I was using, and this seems to work fine in it.
Mantis conversion info:
- Mantis ID: 37870
- OS: Linux
- Build: 63949
- Version: 2.1 (SVN)