Skip to content
Snippets Groups Projects
  • Alexander Böhn's avatar
    Allow `rocksdb.DB` instances to be manually closed · 952e7bb4
    Alexander Böhn authored
    While `delete rocks_ptr` is a deterministic operation in C++, the Python analogue `del rocks_handle` is not – disposal and finalization of the Rocks database are entirely dependent on the Python garbage collector (q.v. the `python-rocksdb` tests themselves, which call `gc.collect()` after `del rocks_handle` to attempt to force the destructor to run). This change exposes a method to trigger the destruction of the underlying Rocks database pointer (deterministic!) through the Python Rocks handle; existing code will not need to be changed, as the Python object destructor (non-deterministic!) will now call this method.
    
    This is the second revision of this PR – it resolves the first revision, #39.
    952e7bb4