Skip to content

Commit

Permalink
Added Shutdown() to free Mode clusters and avoid VerifyOrDie failure …
Browse files Browse the repository at this point in the history
…at src/lib/support/IntrusiveList.h:290: Empty()
  • Loading branch information
jamesharrow committed Jan 19, 2024
1 parent b429bcd commit 5bbd1bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
#include "ValveControlDelegate.h"
#include "WindowCoveringManager.h"
#include "air-quality-instance.h"
#include "device-energy-management-modes.h"
#include "dishwasher-mode.h"
#include "energy-evse-modes.h"
#include "include/tv-callbacks.h"
#include "laundry-dryer-controls-delegate-impl.h"
#include "laundry-washer-controls-delegate-impl.h"
Expand Down Expand Up @@ -251,6 +253,9 @@ void ApplicationShutdown()
Clusters::OvenMode::Shutdown();
Clusters::OvenCavityOperationalState::Shutdown();

Clusters::DeviceEnergyManagementMode::Shutdown();
Clusters::EnergyEvseMode::Shutdown();

if (sChipNamedPipeCommands.Stop() != CHIP_NO_ERROR)
{
ChipLogError(NotSpecified, "Failed to stop CHIP NamedPipeCommands");
Expand Down
5 changes: 5 additions & 0 deletions examples/energy-management-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <EVSEManufacturerImpl.h>
#include <EnergyEvseManager.h>
#include <EnergyManagementManager.h>
#include <device-energy-management-modes.h>
#include <energy-evse-modes.h>

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
Expand Down Expand Up @@ -268,6 +270,9 @@ void ApplicationShutdown()
EVSEManufacturerShutdown(); /* Free the EVSEManufacturer */
EnergyEvseShutdown(); /* Free the EnergyEvse */
DeviceEnergyManagementShutdown(); /* Free the DEM */

Clusters::DeviceEnergyManagementMode::Shutdown();
Clusters::EnergyEvseMode::Shutdown();
}

int main(int argc, char * argv[])
Expand Down

0 comments on commit 5bbd1bc

Please sign in to comment.