Skip to content

Commit

Permalink
Navigator: close the LMDB.Environment on finalize(_:_:_:) (#646)
Browse files Browse the repository at this point in the history
Ensure that we close the LMDB environment on the exit from
`finalize(_:_:_:)` method.  This is important for platforms which do not
permit alteration of directories with open references.  Having the
environment be closed after finalization enables the generated index to
be moved into the final destination on Windows.
  • Loading branch information
compnerd authored Jun 26, 2023
1 parent f71b0f0 commit 2026dcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,9 @@ extension NavigatorIndex {
return
}
}


defer { environment.close() }

let database: LMDB.Database
if let alreadyDefinedDatabase = navigatorIndex.database {
database = alreadyDefinedDatabase
Expand Down

0 comments on commit 2026dcc

Please sign in to comment.