rocksdb-sharp icon indicating copy to clipboard operation
rocksdb-sharp copied to clipboard

Calling Dispose twice on a RocksDb instance throws an AccessViolationException

Open devhawk opened this issue 5 years ago • 0 comments

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.

devhawk avatar Feb 19 '20 06:02 devhawk