sqlite3_close 返回 SQLITE_BUSY 的解决方案

前端之家收集整理的这篇文章主要介绍了sqlite3_close 返回 SQLITE_BUSY 的解决方案前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
void CsqliteDB::Close() { if(m_db) { sqlite3 *db = m_db; m_db = NULL; int rc = sqlite3_close(db); while( rc == sqlITE_BUSY) { // set rc to something that will exit the while loop rc = sqlITE_OK; sqlite3_stmt * stmt = sqlite3_next_stmt(db,NULL); if(stmt != NULL) { rc = sqlite3_finalize(stmt); if(rc == sqlITE_OK) { rc = sqlite3_close(db); } } } } } 原文链接:https://www.f2er.com/sqlite/201710.html

猜你在找的Sqlite相关文章