Skip to content

Commit

Permalink
restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo committed Apr 18, 2023
1 parent b8cdaf1 commit d493f31
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1011,23 +1011,24 @@ - (void)readAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullable)attri
AttributePathParams * attributePathParamsListToFree = attributePathParamsList.Get();
EventPathParams * eventPathParamsListToFree = eventPathParamsList.Get();

auto onDone = [resultArray, interactionStatus, bridge, successCb, failureCb, attributePathParamsListToFree,
eventPathParamsListToFree](BufferedReadClientCallback<MTRDataValueDictionaryDecodableType> * callback) {
if (*interactionStatus != CHIP_NO_ERROR) {
// Failure
failureCb(bridge, *interactionStatus);
} else {
// Success
successCb(bridge, resultArray);
}
if (attributePathParamsListToFree != nullptr) {
Platform::MemoryFree(attributePathParamsListToFree);
}
if (eventPathParamsListToFree != nullptr) {
Platform::MemoryFree(eventPathParamsListToFree);
}
chip::Platform::Delete(callback);
};
auto onDone
= [resultArray, interactionStatus, bridge, successCb, failureCb, attributePathParamsListToFree,
eventPathParamsListToFree](BufferedReadClientCallback<MTRDataValueDictionaryDecodableType> * callback) {
if (*interactionStatus != CHIP_NO_ERROR) {
// Failure
failureCb(bridge, *interactionStatus);
} else {
// Success
successCb(bridge, resultArray);
}
if (attributePathParamsListToFree != nullptr) {
Platform::MemoryFree(attributePathParamsListToFree);
}
if (eventPathParamsListToFree != nullptr) {
Platform::MemoryFree(eventPathParamsListToFree);
}
chip::Platform::Delete(callback);
};

auto callback = chip::Platform::MakeUnique<BufferedReadClientCallback<MTRDataValueDictionaryDecodableType>>(
attributePathParamsList.Get(), readParams.mAttributePathParamsListSize, eventPathParamsList.Get(),
Expand Down

0 comments on commit d493f31

Please sign in to comment.