From 1a6c1a5ddd5379c205fa0db9175b2a53d1e1cdc1 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Thu, 5 Jun 2014 13:34:38 +0100 Subject: [PATCH] Fix build --- java/org/rocksdb/RestoreBackupableDB.java | 8 +++----- java/org/rocksdb/RestoreOptions.java | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/java/org/rocksdb/RestoreBackupableDB.java b/java/org/rocksdb/RestoreBackupableDB.java index 8c6dbf531..dbde447a0 100644 --- a/java/org/rocksdb/RestoreBackupableDB.java +++ b/java/org/rocksdb/RestoreBackupableDB.java @@ -68,11 +68,9 @@ public class RestoreBackupableDB extends RocksObject { * Release the memory allocated for the current instance * in the c++ side. */ - @Override public synchronized void dispose() { - if (isInitialized()) { - dispose(nativeHandle_); - nativeHandle_ = 0; - } + @Override public synchronized void disposeInternal() { + assert(isInitialized()); + dispose(nativeHandle_); } private native long newRestoreBackupableDB(long options); diff --git a/java/org/rocksdb/RestoreOptions.java b/java/org/rocksdb/RestoreOptions.java index 0321c3b9c..77a2b99bc 100644 --- a/java/org/rocksdb/RestoreOptions.java +++ b/java/org/rocksdb/RestoreOptions.java @@ -27,11 +27,9 @@ public class RestoreOptions extends RocksObject { * Release the memory allocated for the current instance * in the c++ side. */ - @Override public synchronized void dispose() { - if (isInitialized()) { - dispose(nativeHandle_); - nativeHandle_ = 0; - } + @Override public synchronized void disposeInternal() { + assert(isInitialized()); + dispose(nativeHandle_); } private native long newRestoreOptions(boolean keepLogFiles);