Hi,

I have a QSqlQueryModel, which I feed a query with setQuery(const QSqlQuery & 
query).
Works great the first time I do this. Works too, if I use setQuery(const 
QSqlQuery & query)
a second+ time to change the query. However, after the 1st time I get on the 
console:

> ?libqsqlpsql.so? -- 0 -- Unable to free statement: ERROR:  prepared statement 
> "qpsqlpstmt_<X>" does not exist

The program works as expected, but messages like that make me a bit nervous and 
I try everything to get rid 
of them. The only way I found to avoid this was to create for each setQuery 
call a QSqlQuery on the heap and
never delete it... ugly memory leak.

Here is a similar bug report on SO:
http://stackoverflow.com/questions/12888134/qtsql-prepared-statement-qpsqlpstmt-1-does-not-exist-on-clear-of-model

I don't call clear on my QSqlQueryModel (though I tried this too) before I 
deleted the query. I suppose the destructor 
of QSqlQuery does something after the db connection was dropped.

Anyone a comment on this before I write a possibly useless bug report?

Guido

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to