Fix crash when deleting a QSqlQueryModel after closing the database
Task-number: QTBUG-66553 Change-Id: Ib5c04ebe5ac2b7581613e0044804072eb0980b2e Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
parent
992f673782
commit
5f66486cc2
@ -462,8 +462,10 @@ void QPSQLResult::cleanup()
|
||||
d->result = nullptr;
|
||||
while (!d->nextResultSets.isEmpty())
|
||||
PQclear(d->nextResultSets.takeFirst());
|
||||
if (d->stmtId != InvalidStatementId)
|
||||
d->drv_d_func()->finishQuery(d->stmtId);
|
||||
if (d->stmtId != InvalidStatementId) {
|
||||
if (d->drv_d_func())
|
||||
d->drv_d_func()->finishQuery(d->stmtId);
|
||||
}
|
||||
d->stmtId = InvalidStatementId;
|
||||
setAt(QSql::BeforeFirstRow);
|
||||
d->currentSize = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user