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 f676acb
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1011,23 +1011,25 @@ - (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 f676acb

Please sign in to comment.