提交 01312e75 编写于 作者: Y Yingchun Lai 提交者: neverchanje

fix: use db when it has been opened (#481)

上级 e0bca499
......@@ -414,7 +414,14 @@ void pegasus_server_impl::parse_checkpoints()
}
}
pegasus_server_impl::~pegasus_server_impl() = default;
pegasus_server_impl::~pegasus_server_impl()
{
if (_is_open) {
dassert(_db != nullptr, "");
delete _db;
_db = nullptr;
}
}
void pegasus_server_impl::gc_checkpoints(bool force_reserve_one)
{
......@@ -1664,8 +1671,10 @@ void pegasus_server_impl::on_clear_scanner(const int64_t &args) { _context_cache
void pegasus_server_impl::cancel_background_work(bool wait)
{
dassert(_db != nullptr, "");
rocksdb::CancelAllBackgroundWork(_db, wait);
if (_is_open) {
dassert(_db != nullptr, "");
rocksdb::CancelAllBackgroundWork(_db, wait);
}
}
::dsn::error_code pegasus_server_impl::stop(bool clear_state)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册