Skip to content

Commit

Permalink
MB-47462: Add virtual destructor for CheckpointManager
Browse files Browse the repository at this point in the history
Many tests substitute a MockCheckpointManager (inherits from
CheckpointManager).

To ensure the MockCM is handled correctly when destroyed through a
std::unique_ptr<CheckpointManager>, the base type must have a virtual
destructor.

Change-Id: I39cf64eb97b016452fd2c9d9865d4904efb6507d
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/162090
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
jameseh96 authored and daverigby committed Sep 23, 2021
1 parent 14fbcdd commit fddcfad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engines/ep/src/checkpoint_manager.cc
Expand Up @@ -67,6 +67,8 @@ CheckpointManager::CheckpointManager(EPStats& st,
}
}

CheckpointManager::~CheckpointManager() = default;

uint64_t CheckpointManager::getOpenCheckpointId(
const std::lock_guard<std::mutex>& lh) {
return getOpenCheckpoint_UNLOCKED(lh).getId();
Expand Down
2 changes: 2 additions & 0 deletions engines/ep/src/checkpoint_manager.h
Expand Up @@ -147,6 +147,8 @@ class CheckpointManager {
uint64_t maxVisibleSeqno,
FlusherCallback cb);

virtual ~CheckpointManager();

uint64_t getOpenCheckpointId();

uint64_t getLastClosedCheckpointId();
Expand Down

0 comments on commit fddcfad

Please sign in to comment.