Skip to content

Update database.cpp#6

Open
Maxd646 wants to merge 1 commit into
mainfrom
database_integration
Open

Update database.cpp#6
Maxd646 wants to merge 1 commit into
mainfrom
database_integration

Conversation

@Maxd646
Copy link
Copy Markdown
Collaborator

@Maxd646 Maxd646 commented May 12, 2025

adding : db = nullptr; in the void closeDatabase() to Prevent dangling pointer like in the below

void closeDatabase() {
if (db) {
sqlite3_close(db); // Close the SQLite database connection
db = nullptr; // Prevent dangling pointer
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant