Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3fae3b4

Browse files
committedJan 27, 2024
Unregister EEM attribute access in destructor
1 parent 272ca37 commit 3fae3b4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

‎src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Init()
4444
return CHIP_NO_ERROR;
4545
}
4646

47+
void ElectricalEnergyMeasurementAttrAccess::Shutdown()
48+
{
49+
unregisterAttributeAccessOverride(this);
50+
}
51+
4752
CHIP_ERROR ElectricalEnergyMeasurementAttrAccess::Read(const app::ConcreteReadAttributePath & aPath,
4853
app::AttributeValueEncoder & aEncoder)
4954
{

‎src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.h

+4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ class ElectricalEnergyMeasurementAttrAccess : public AttributeAccessInterface
4444
mFeature(aFeature)
4545
{}
4646

47+
~ElectricalEnergyMeasurementAttrAccess() { Shutdown(); }
48+
4749
CHIP_ERROR Init();
50+
void Shutdown();
51+
4852
CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override;
4953

5054
private:

0 commit comments

Comments
 (0)
Please sign in to comment.