Ver código fonte

Plug database connection leak in SqlQueryView::setQuery()

Neal Wilson 10 anos atrás
pai
commit
3571c8d534
1 arquivos alterados com 1 adições e 2 exclusões
  1. 1
    2
      src/typica.w

+ 1
- 2
src/typica.w Ver arquivo

@@ -12721,8 +12721,6 @@ void SqlQueryView::openRow(const QModelIndex &index)
12721 12721
 
12722 12722
 @ The other functions are wrappers around model methods.
12723 12723
 
12724
-\danger |setQuery()| leaks database connections.
12725
-
12726 12724
 @<SqlQueryView implementation@>=
12727 12725
 void SqlQueryView::setQuery(const QString &query)
12728 12726
 {
@@ -12730,6 +12728,7 @@ void SqlQueryView::setQuery(const QString &query)
12730 12728
 	database.open();
12731 12729
 	QSqlQuery q(query, database);
12732 12730
 	((QSqlQueryModel*)model())->setQuery(q);
12731
+	database.close();
12733 12732
 }
12734 12733
 
12735 12734
 bool SqlQueryView::setHeaderData(int section, Qt::Orientation@, orientation,

Carregando…
Cancelar
Salvar