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.
While
delete rocks_ptr
is a deterministic operation in C++, the Python analoguedel rocks_handle
is not – disposal and finalization of the Rocks database are entirely dependent on the Python garbage collector (q.v. thepython-rocksdb
tests themselves, which callgc.collect()
afterdel 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.