mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Java Bindings: prevent segfault from double delete
Give BackupableDB sole responsibility of the native object to prevent RocksDB from also trying to delete it.
This commit is contained in:
@@ -31,6 +31,10 @@ public class BackupableDB extends RocksDB {
|
||||
BackupableDB bdb = new BackupableDB(RocksDB.open(opt, db_path));
|
||||
bdb.open(bdb.db_.nativeHandle_, bopt.nativeHandle_);
|
||||
|
||||
// Prevent the RocksDB object from attempting to delete
|
||||
// the underly C++ DB object.
|
||||
bdb.db_.disOwnNativeObject();
|
||||
|
||||
return bdb;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user