summaryrefslogtreecommitdiffstats
path: root/src/assistant/help/qhelpcollectionhandler_p.h
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2018-01-19 16:44:18 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2018-04-05 13:39:59 +0000
commit49a5c5547d499183f25cbfee8612ed7b6dcc8b76 (patch)
tree4bcb901952bc6036f59c81141b0d93dc7d4be42e /src/assistant/help/qhelpcollectionhandler_p.h
parent61062f6769670b1a33c3f4406d51892c221a26fd (diff)
Create QHelpCollectionHandler's query dynamically
It fixes a warning about the use of db from the wrong thread. Before, the default m_query object was created in QHelpCollectionHandler constructor which caused the warning to appear. Now we create m_query object dynamically instead. This also fixed a leak in QHelpCollectionHandler::openCollectionFile() where two early returns, after the database had been opened, neither closed it nor set m_dbOpened. Change-Id: I24484d25d9d90b1a5d6fe4a5acb61c834e2b9599 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/assistant/help/qhelpcollectionhandler_p.h')
-rw-r--r--src/assistant/help/qhelpcollectionhandler_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/assistant/help/qhelpcollectionhandler_p.h b/src/assistant/help/qhelpcollectionhandler_p.h
index 2b1b57718..d804b3f04 100644
--- a/src/assistant/help/qhelpcollectionhandler_p.h
+++ b/src/assistant/help/qhelpcollectionhandler_p.h
@@ -109,12 +109,12 @@ signals:
private:
bool isDBOpened();
+ void closeDB();
bool createTables(QSqlQuery *query);
- bool m_dbOpened;
QString m_collectionFile;
QString m_connectionName;
- mutable QSqlQuery m_query;
+ QSqlQuery *m_query = nullptr;
};
QT_END_NAMESPACE