Skip to content

Commit f14a224

Browse files
committed
Update from comments
1 parent 219c529 commit f14a224

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/controller/java/AndroidCallbacks.h

-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ struct InvokeCallback : public app::CommandSender::Callback
129129

130130
void OnDone(app::CommandSender * apCommandSender) override;
131131

132-
// CHIP_ERROR CreateInvokeElement(JNIEnv * env, const app::ConcreteCommandPath & aPath, TLV::TLVReader * apData, jobject &
133-
// outObj);
134132
void ReportError(CHIP_ERROR err);
135133
void ReportError(Protocols::InteractionModel::Status status);
136134
void ReportError(const char * message, ChipError::StorageType errorCode);

src/controller/java/AndroidInteractionClient.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ CHIP_ERROR read(JNIEnv * env, jlong handle, jlong callbackHandle, jlong devicePt
232232

233233
SuccessOrExit(err = readClient->SendRequest(params));
234234
callback->mReadClient = readClient;
235-
236-
return CHIP_NO_ERROR;
237235
exit:
238236
if (err != CHIP_NO_ERROR)
239237
{
@@ -247,10 +245,12 @@ CHIP_ERROR read(JNIEnv * env, jlong handle, jlong callbackHandle, jlong devicePt
247245
if (readClient != nullptr)
248246
{
249247
Platform::Delete(readClient);
248+
readClient = nullptr;
250249
}
251250
if (callback != nullptr)
252251
{
253252
Platform::Delete(callback);
253+
callback = nullptr;
254254
}
255255
}
256256

@@ -405,8 +405,6 @@ CHIP_ERROR write(JNIEnv * env, jlong handle, jlong callbackHandle, jlong deviceP
405405
imTimeoutMs != 0 ? System::Clock::Milliseconds32(imTimeoutMs) : System::Clock::kZero);
406406
SuccessOrExit(err);
407407
callback->mWriteClient = writeClient;
408-
409-
return CHIP_NO_ERROR;
410408
exit:
411409
if (err != CHIP_NO_ERROR)
412410
{
@@ -420,10 +418,12 @@ CHIP_ERROR write(JNIEnv * env, jlong handle, jlong callbackHandle, jlong deviceP
420418
if (writeClient != nullptr)
421419
{
422420
Platform::Delete(writeClient);
421+
writeClient = nullptr;
423422
}
424423
if (callback != nullptr)
425424
{
426425
Platform::Delete(callback);
426+
callback = nullptr;
427427
}
428428
}
429429
return err;
@@ -555,8 +555,6 @@ CHIP_ERROR invoke(JNIEnv * env, jlong handle, jlong callbackHandle, jlong device
555555
: Optional<System::Clock::Timeout>::Missing()));
556556

557557
callback->mCommandSender = commandSender;
558-
559-
return CHIP_NO_ERROR;
560558
exit:
561559
if (err != CHIP_NO_ERROR)
562560
{
@@ -570,10 +568,12 @@ CHIP_ERROR invoke(JNIEnv * env, jlong handle, jlong callbackHandle, jlong device
570568
if (commandSender != nullptr)
571569
{
572570
Platform::Delete(commandSender);
571+
commandSender = nullptr;
573572
}
574573
if (callback != nullptr)
575574
{
576575
Platform::Delete(callback);
576+
callback = nullptr;
577577
}
578578
}
579579
return err;

0 commit comments

Comments
 (0)