Skip to content

database file is locked even after database::disconnect #29

@andreo-k

Description

@andreo-k

The bug in your code:

int database::disconnect()
{
int rc = SQLITE_OK;
if (db_) {
rc = sqlite3_close(db_);
db_ = 0;
}
return rc;
}

if sqlite3_close returned an error, db_ becomes NULL and database never closed.

Probably, you should add rc check
if (rc == SQLITE_OK)
db_ = 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions