From 486e009b5ca6725a3a4e6a6de4b904c83c5e4d01 Mon Sep 17 00:00:00 2001 From: Philip Gregor Date: Thu, 4 Apr 2024 11:18:35 -0700 Subject: [PATCH] Addressed comment by bzbarsky-apple simplified --- src/platform/android/DnssdImpl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/platform/android/DnssdImpl.cpp b/src/platform/android/DnssdImpl.cpp index 25e07aa2832d1a..b272ed5a712414 100644 --- a/src/platform/android/DnssdImpl.cpp +++ b/src/platform/android/DnssdImpl.cpp @@ -219,15 +219,14 @@ CHIP_ERROR ChipDnssdStopBrowse(intptr_t browseIdentifier) env->CallVoidMethod(sBrowserObject.ObjectRef(), sStopBrowseMethod, reinterpret_cast(ctx->callback)); + chip::Platform::Delete(ctx); if (env->ExceptionCheck()) { ChipLogError(Discovery, "Java exception in ChipDnssdStopBrowse"); env->ExceptionDescribe(); env->ExceptionClear(); - chip::Platform::Delete(ctx); return CHIP_JNI_ERROR_EXCEPTION_THROWN; } - chip::Platform::Delete(ctx); return CHIP_NO_ERROR; }