Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jsc): fix jsc memery release #4155

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions driver/js/src/scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ Scope::Scope(std::weak_ptr<Engine> engine,

Scope::~Scope() {
FOOTSTONE_DLOG(INFO) << "~Scope";
#ifdef JS_JSC
/*
* JSObjectFinalizeCallback will be called when you call JSContextGroupRelease, so it is necessary to hold the wrapper when ctx is destroyed.
*/
#else
context_ = nullptr;
auto engine = engine_.lock();
FOOTSTONE_DCHECK(engine);
if (engine) {
Expand All @@ -145,7 +141,6 @@ Scope::~Scope() {
engine->ClearFunctionWrapper(key);
engine->ClearClassTemplate(key);
}
#endif
}

void Scope::WillExit() {
Expand Down
5 changes: 2 additions & 3 deletions framework/ios/base/executors/HippyJSExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,8 @@ - (void)invalidate {
HippyLogInfo(@"[Hippy_OC_Log][Life_Circle],HippyJSCExecutor invalide %p", self);
_valid = NO;
#ifdef JS_JSC
auto scope = self.pScope;
if (scope) {
auto jsc_context = std::static_pointer_cast<hippy::napi::JSCCtx>(scope->GetContext());
if (self.pScope) {
auto jsc_context = std::static_pointer_cast<hippy::napi::JSCCtx>(self.pScope->GetContext());
static CFStringRef delName = CFSTR("HippyJSContext(delete)");
jsc_context->SetName(delName);
}
Expand Down
Loading