Skip to content

Commit

Permalink
[CI] Placeholder app segfault after commissioning complete event is r…
Browse files Browse the repository at this point in the history
…eceived (#11522)
  • Loading branch information
vivien-apple authored and pull[bot] committed Feb 22, 2022
1 parent 6019638 commit 1095600
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/placeholder/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,29 @@

#include "MatterCallbacks.h"

void RunTestCommand()
std::unique_ptr<TestCommand> RunTestCommand()
{
const char * command = LinuxDeviceOptions::GetInstance().command;
if (command == nullptr)
{
return;
return nullptr;
}

auto test = GetTestCommand(command);
if (test.get() == nullptr)
{
ChipLogError(chipTool, "Specified test command does not exists: %s", command);
return;
return nullptr;
}

chip::DeviceLayer::PlatformMgr().AddEventHandler(OnPlatformEvent, reinterpret_cast<intptr_t>(test.get()));
return test;
}

int main(int argc, char * argv[])
{
VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0);
RunTestCommand();
auto test = RunTestCommand();
ChipLinuxAppMainLoop();
return 0;
}

0 comments on commit 1095600

Please sign in to comment.