SQLite Handle Not Finalized (ARCH9084)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key swift.performance.sqlite-handle-not-finalized · Severity error · Category performance
Flags sqlite3_open without sqlite3_close, and sqlite3_prepare_v2 without sqlite3_finalize, in the same scope.
Incorrect
Section titled “Incorrect”sqlite3_prepare_v2(db, sql, -1, &stmt, nil)while sqlite3_step(stmt) == SQLITE_ROW { }Correct
Section titled “Correct”defer { sqlite3_finalize(stmt) }Finalize statements and close the database in a defer.