Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions google/cloud/bigtable/internal/query_plan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ std::shared_ptr<QueryPlan> QueryPlan::Create(
return plan;
}

QueryPlan::~QueryPlan() {
if (refresh_timer_.valid()) refresh_timer_.cancel();
}

void QueryPlan::Initialize() {
std::unique_lock<std::mutex> lock(mu_);
if (state_ == RefreshState::kDone) ScheduleRefresh(lock);
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigtable/internal/query_plan.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class QueryPlan : public std::enable_shared_from_this<QueryPlan> {
StatusOr<google::bigtable::v2::PrepareQueryResponse> response,
RefreshFn fn, std::shared_ptr<Clock> clock = std::make_shared<Clock>());

~QueryPlan();

// Invalidates the current QueryPlan and triggers a refresh.
void Invalidate(Status status, std::string const& invalid_query_plan_id);

Expand Down