From 88ce2d8b2c2ccf5568d1b95f0bf9df47179f658a Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Wed, 8 Feb 2023 12:56:06 -0300 Subject: [PATCH] fix: memory leak on accessing static interface methods --- test-app/runtime/src/main/cpp/JEnv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test-app/runtime/src/main/cpp/JEnv.cpp b/test-app/runtime/src/main/cpp/JEnv.cpp index 345e70db6..cc6629749 100644 --- a/test-app/runtime/src/main/cpp/JEnv.cpp +++ b/test-app/runtime/src/main/cpp/JEnv.cpp @@ -865,11 +865,11 @@ JEnv::GetInterfaceStaticMethodIDAndJClass(const std::string &interfaceName, const std::string &methodName, const std::string &sig) { - auto companionClassNameResolver = new DesugaredInterfaceCompanionClassNameResolver(); + DesugaredInterfaceCompanionClassNameResolver companionClassNameResolver; std::string possibleCalleeNames[] = {interfaceName, - companionClassNameResolver->resolveBazelInterfaceCompanionClassName( + companionClassNameResolver.resolveBazelInterfaceCompanionClassName( interfaceName), - companionClassNameResolver->resolveD8InterfaceCompanionClassName( + companionClassNameResolver.resolveD8InterfaceCompanionClassName( interfaceName)}; for (std::string calleeName: possibleCalleeNames) {