Check driver validity before using it
authorHonglei Zhang <honglei.zhang@nokia.com>
Thu, 8 Dec 2011 13:38:25 +0000 (15:38 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 12 Dec 2011 09:43:44 +0000 (10:43 +0100)
commit67be01ae5048138e894fa8d3eb0abe93c5699048
treeccb2c3f3e0c3f742d3a4f1b5d2cd20fd70521f20
parentb9ebb65c77ea779d4abbf92e93b8bef5a41c84bc
Check driver validity before using it

Even though it is stated in the documentation that the SQL driver must
remain valid during the life time of QSqlQuery, there are users who don't
follow the rule. It's common that the destructor of QSqlQuery is called
after the driver is already deleted. This fix checks the validity of
the SQLite driver before QSqliteResult uses it in destructor.

Task-number: QTBUG-16967
Change-Id: If0f52113f12e14102da1671cd6e12bdaa267114f
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
src/sql/drivers/sqlite/qsql_sqlite.cpp
src/sql/kernel/qsqlresult.cpp
tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp