Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ C++;:铁路超高';t关闭后删除sqlite文件_C++_Sqlite - Fatal编程技术网

C++ C++;:铁路超高';t关闭后删除sqlite文件

C++ C++;:铁路超高';t关闭后删除sqlite文件,c++,sqlite,C++,Sqlite,我用以下函数编写了一个sqlite类: bool Csqlite::init (string _InFile) { if (sqlite3_open_v2(_InFile.c_str (), &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL) == SQLITE_ERROR) return false; return true; } void Csqlite::quit () { sq

我用以下函数编写了一个sqlite类:

bool Csqlite::init (string _InFile)
{
    if (sqlite3_open_v2(_InFile.c_str (), &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL) == SQLITE_ERROR)
         return false;

    return true;
}

void Csqlite::quit ()
{
    sqlite3_reset (stmt);
    sqlite3_clear_bindings (stmt);

    sqlite3_close(db);
}

bool Csqlite::execute (string _InOperation)
{
    if (sqlite3_prepare_v2 (db, _InOperation.c_str (), _InOperation.size () + 1, &stmt, NULL) != 0)
        return false;

    if (sqlite3_step (stmt) == SQLITE_ERROR)
        return false;

    return true;
}
现在,奇怪的是,如果我调用
init
,而不调用其他
quit
,我就可以在windows中删除本地文件。但是,当我在这两个函数之间调用
execute
并再次尝试删除该文件时,Windows会说该文件已打开


有什么想法吗?

你忘了用它来释放声明