ifcparse: skip flush+compact for read-only RocksDB on destruction

Read-only handles reject Flush/CompactRange, so the destructor's status
assertion always fired on shutdown when the streamer's sidecar was
opened with read_only=true. Track the flag and skip the write path; also
guard against a null db when the initial open failed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-07 10:16:15 +10:00
parent f07afda09c
commit 0bb6df6a6b
2 changed files with 16 additions and 9 deletions
+2
View File
@@ -390,6 +390,8 @@ namespace ifcopenshell {
typedef rocksdb_map_adapter<inverse_attr_record, std::vector<uint32_t>> entities_by_ref_t;
entities_by_ref_t byref_excl_;
bool read_only_ = false;
// @todo naming
rocks_db_file_storage(const std::string& path, ifcopenshell::file* owner_file, bool read_only = false);
~rocks_db_file_storage();