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(perf): fix OnResourceLoadEnd crash #3895

Merged
merged 1 commit into from
Jun 12, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ std::shared_ptr<Scope> GetScope(jint j_scope_id) {

void OnNativeInitEnd(JNIEnv* j_env, jobject j_object, jint j_scope_id, jlong startTime, jlong endTime) {
auto scope = GetScope(j_scope_id);
if (!scope) {
return;
}
auto engine = scope->GetEngine().lock();
if (!engine) {
return;
Expand All @@ -191,6 +194,9 @@ void OnNativeInitEnd(JNIEnv* j_env, jobject j_object, jint j_scope_id, jlong sta

void OnFirstPaintEnd(JNIEnv* j_env, jobject j_object, jint j_scope_id, jlong time) {
auto scope = GetScope(j_scope_id);
if (!scope) {
return;
}
auto engine = scope->GetEngine().lock();
if (!engine) {
return;
Expand Down Expand Up @@ -219,6 +225,9 @@ void OnFirstPaintEnd(JNIEnv* j_env, jobject j_object, jint j_scope_id, jlong tim

void OnFirstContentfulPaintEnd(JNIEnv* j_env, jobject j_object, jint j_scope_id, jlong time) {
auto scope = GetScope(j_scope_id);
if (!scope) {
return;
}
auto engine = scope->GetEngine().lock();
if (!engine) {
return;
Expand Down Expand Up @@ -247,6 +256,9 @@ void OnResourceLoadEnd(JNIEnv* j_env, jobject j_object, jint j_scope_id, jstring
auto ret_code = static_cast<int32_t>(j_ret_code);
auto error_msg = j_error_msg ? JniUtils::ToStrView(j_env, j_error_msg) : string_view("");
auto scope = GetScope(j_scope_id);
if (!scope) {
return;
}
auto engine = scope->GetEngine().lock();
if (!engine) {
return;
Expand Down
Loading