Skip to content

Commit

Permalink
Fix: crash while destructing crmorch (sonic-net#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiluo-msft authored and renukamanavalan committed Jun 24, 2019
1 parent ba29927 commit 6771fea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion orchagent/crmorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ CrmOrch::CrmOrch(DBConnector *db, string tableName):
m_resourcesMap.emplace(res.first, CrmResourceEntry(res.second, CRM_THRESHOLD_TYPE_DEFAULT, CRM_THRESHOLD_LOW_DEFAULT, CRM_THRESHOLD_HIGH_DEFAULT));
}

auto executor = new ExecutableTimer(m_timer.get(), this);
// Note: ExecutableTimer will hold m_timer pointer and release the object later
auto executor = new ExecutableTimer(m_timer, this);
Orch::addExecutor("CRM_COUNTERS_POLL", 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

0 comments on commit 6771fea

Please sign in to comment.