ownSql: Don't set busy timeout on bad object

This commit is contained in:
Markus Goetz 2014-10-28 21:46:30 +01:00
parent 105ff694f2
commit ff570c4a6b

View File

@ -50,11 +50,14 @@ bool SqlDatabase::open( const QString& filename )
SQLITE_DO( sqlite3_open_v2(filename.toUtf8().constData(), &_db, flag, 0) );
if( _errId != SQLITE_OK ) {
close(); // FIXME: Correct?
qDebug() << Q_FUNC_INFO << "Error:" << _error;
close();
_db = 0;
}
sqlite3_busy_timeout(_db, 5000);
if (_db) {
sqlite3_busy_timeout(_db, 5000);
}
return isOpen();
}