Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: crash while destructing crmorch #731

Merged
merged 1 commit into from
Dec 21, 2018
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
3 changes: 2 additions & 1 deletion orchagent/crmorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ CrmOrch::CrmOrch(DBConnector *db, string tableName):
// The CRM stats needs to be populated again
m_countersCrmTable->del(CRM_COUNTERS_TABLE_KEY);

auto executor = new ExecutableTimer(m_timer.get(), this, "CRM_COUNTERS_POLL");
// Note: ExecutableTimer will hold m_timer pointer and release the object later
auto executor = new ExecutableTimer(m_timer, this, "CRM_COUNTERS_POLL");
Orch::addExecutor(executor);
m_timer->start();
}
Expand Down
2 changes: 1 addition & 1 deletion orchagent/crmorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CrmOrch : public Orch
private:
shared_ptr<DBConnector> m_countersDb = nullptr;
shared_ptr<Table> m_countersCrmTable = nullptr;
shared_ptr<SelectableTimer> m_timer = nullptr;
SelectableTimer *m_timer = nullptr;

struct CrmResourceCounter
{
Expand Down