View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037993 | FPC | Database | public | 2020-10-27 03:44 | 2020-10-27 09:28 |
Reporter | Zamrony P. Juhara | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 3.3.1 | ||||
Summary | 0037993: TSQLConnection destructor may raise exception leading to memory leak | ||||
Description | From https://github.com/graemeg/freepascal/blob/master/packages/fcl-db/src/sqldb/sqldb.pp destructor TSQLConnection.Destroy; begin Connected:=False; // needed because we want to de-allocate statements FreeAndNil(FStatements); inherited Destroy; end; If it is connected then later database server shuts down, Connected:=false may raise exception which cause destruction incomplete and leaking memory | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 47216 | ||||
FPCOldBugId | |||||
FPCTarget | 3.2.2 | ||||
Attached Files |
|
|
I have added a possible fix, but it is very doubtful this will catch all possible cases. When you suspect the database connection has gone, you should set ForcedClose:=True; or use Close(True) on the connection. This will close all datasets but ignores all errors that can happen when the DB has gone away. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-27 03:44 | Zamrony P. Juhara | New Issue | |
2020-10-27 09:14 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2020-10-27 09:14 | Michael Van Canneyt | Status | new => assigned |
2020-10-27 09:22 | Michael Van Canneyt | Assigned To | Michael Van Canneyt => |
2020-10-27 09:22 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2020-10-27 09:28 | Michael Van Canneyt | Status | assigned => resolved |
2020-10-27 09:28 | Michael Van Canneyt | Resolution | open => fixed |
2020-10-27 09:28 | Michael Van Canneyt | Fixed in Version | => 3.3.1 |
2020-10-27 09:28 | Michael Van Canneyt | Fixed in Revision | => 47216 |
2020-10-27 09:28 | Michael Van Canneyt | FPCTarget | => 3.2.2 |
2020-10-27 09:28 | Michael Van Canneyt | Note Added: 0126577 |