Skip to content

Commit

Permalink
Android: Fix memory leak in DnssdImpl.cpp ChipDnssdStopBrowse() (#32855)
Browse files Browse the repository at this point in the history
* Android: Fix memory leak in ChipDnssdStopBrowse - Addressed comment by bzbarsky-apple

* Addressed comment by bzbarsky-apple simplified
  • Loading branch information
pgregorr-amazon authored and pull[bot] committed Dec 18, 2024
1 parent e855e6b commit 1217647
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/android/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ CHIP_ERROR ChipDnssdStopBrowse(intptr_t browseIdentifier)

env->CallVoidMethod(sBrowserObject.ObjectRef(), sStopBrowseMethod, reinterpret_cast<jlong>(ctx->callback));

chip::Platform::Delete(ctx);
if (env->ExceptionCheck())
{
ChipLogError(Discovery, "Java exception in ChipDnssdStopBrowse");
env->ExceptionDescribe();
env->ExceptionClear();
return CHIP_JNI_ERROR_EXCEPTION_THROWN;
}
chip::Platform::Delete(ctx);

return CHIP_NO_ERROR;
}
Expand Down

0 comments on commit 1217647

Please sign in to comment.