PDA

View Full Version : QSqlDatabase::close() sigsev exception



Raccoon29
4th December 2009, 10:07
Hello,

posting code here is quite endless because is a big lot of code...I don't want to waste your precious time :)
Instead I ask for tips about a strange behavior:
I have a nice QSqlDatabase object, valid, open and cute, everything works fine. Once in a day it has to be closed, so I do


// QVector<QSqlDatabase> *vHandle; // vector of connections
// int vIndex; // current index=0, vHandle->count()=1
QSqlDatabase app=vHandle->at(vIndex);
app.close(); // ! exception
vHandle->replace(vIndex,app);

app.close() raises exception, in detail QMYSQLDriver::close() does, and more in detail mysql_close(d->mysql) does (I can't go deeper debugging).
So the question is: why should QSqlDatabase::close() raise exception? Aware of this I could find my issue easier.

EDIT: it is not just close()! Also mysql_real_query raises exception when executing query (QSqlQuery::exec())... now I have to understand why it has to crash instead of warn/fail/anything-else-nicer... any idea?

Thanks thanks thanks.

Raccoon29
21st December 2009, 09:54
This problem has been solved in the following thread:
http://www.qtcentre.org/forum/f-qt-programming-2/t-simple-code-causes-segmentation-faultin-debug-26645-post127126.html#post127126