Fix the mem leak from js method

Signed-off-by: xiongluo <xiongluo@huawei.com>
This commit is contained in:
xiongluo
2022-05-23 20:57:44 +08:00
parent 6812726dd6
commit 2c14680bc6
24 changed files with 210 additions and 135 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ HWTEST_F_L0(NativePointerTest, Print)
JSHandle<JSFunction> jsFunction = factory->NewJSFunction(env);
EXPECT_TRUE(*jsFunction != nullptr);
JSMethod *target = thread->GetEcmaVM()->GetMethodForNativeFunction(nullptr);
JSMethod *target = factory->NewMethodForNativeFunction(nullptr);
jsFunction->SetCallTarget(thread, target);
// run cpp methed 'Print'