Skip to content

Commit

Permalink
Unregister EEM attribute access in destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hasty committed Jan 27, 2024
1 parent 272ca37 commit 3fae3b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Init()
return CHIP_NO_ERROR;
}

void ElectricalEnergyMeasurementAttrAccess::Shutdown()
{
unregisterAttributeAccessOverride(this);
}

CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Read(const app::ConcreteReadAttributePath & aPath,
app::AttributeValueEncoder & aEncoder)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ class ElectricalEnergyMeasurementAttrAccess : public AttributeAccessInterface
mFeature(aFeature)
{}

~ElectricalEnergyMeasurementAttrAccess() { Shutdown(); }

CHIP_ERROR Init();
void Shutdown();

CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;

private:
Expand Down

0 comments on commit 3fae3b4

Please sign in to comment.