Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling Dispose twice on a RocksDb instance throws an AccessViolationException #76

Open
devhawk opened this issue Feb 19, 2020 · 0 comments · May be fixed by #77
Open

Calling Dispose twice on a RocksDb instance throws an AccessViolationException #76

devhawk opened this issue Feb 19, 2020 · 0 comments · May be fixed by #77

Comments

@devhawk
Copy link

devhawk commented Feb 19, 2020

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.

@mookid8000 mookid8000 linked a pull request May 11, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant