rocksdb-sharp
rocksdb-sharp copied to clipboard
Calling Dispose twice on a RocksDb instance throws an AccessViolationException
Repro Code:
class Program
{
static void Main(string[] args)
{
var options = new RocksDbSharp.DbOptions()
.SetCreateIfMissing(true)
.SetCreateMissingColumnFamilies(true);
using(var db = RocksDbSharp.RocksDb.Open(options, "database"))
{
db.Dispose();
}
}
}
RocksDbSharp Version: 6.2.2
Expected Behavior: process terminates normally
Actual Behavior: process terminates with Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
From IDispose Remarks:
If an object's Dispose method is called more than once, the object must ignore all calls after the first one. The object must not throw an exception if its Dispose method is called multiple times.