mirror of
https://github.com/openharmony/ark_js_runtime.git
synced 2026-08-27 20:40:01 -04:00
Fix the mem leak from js method
Signed-off-by: xiongluo <xiongluo@huawei.com>
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user