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

iOS controller pop 后 app 崩溃 #421

Open
liuhaijing-lab opened this issue Feb 16, 2023 · 0 comments
Open

iOS controller pop 后 app 崩溃 #421

liuhaijing-lab opened this issue Feb 16, 2023 · 0 comments
Labels
bug Something isn't working Needs: Triage 🔍

Comments

@liuhaijing-lab
Copy link

描述

iOS controller pop 后 app 崩溃

Hummer version:

master branch

复现步骤

  1. 导出 tabbar 视图组件
    2.组件中使用原生 UITabBarController
    3.UITabBarController 管理多个 HMViewController
    4.HMViewController 加载 js 资源
    5.tabbar 所在控制器 pop 后 控制台输出 ‘HMJSContext 销毁’
    6.执行到 HMJSCExecutor.m 1315行 后崩溃

预期结果

组件正常销毁

样例代码、屏幕截图或者仓库链接

js 使用:

let tabBar = new TabBar()
tabBar.items = [{},{}]
this.appendChild(tabBar)

tabbar 视图组件关键代码:

HMJSContext *context = [HMJSGlobal.globalObject currentContext:self.hmContext];

NSURL *url = [NSURL URLWithString:urlString];
if (url.scheme.length == 0) {
    if (context) {
        url = [[NSURL alloc] initWithString:urlString relativeToURL:context.url];
        if (url.scheme.length == 0) {
            return;
        }
    } else {
        return;
    }
}

HMViewController *controller = [[HMViewController alloc] initWithURL:url.absoluteString params:@{}];
[self setTabBarItemImage:controller.tabBarItem imageSrc:imageSrc isSelectedImage:NO];
[self setTabBarItemImage:controller.tabBarItem imageSrc:selectedImageSrc isSelectedImage:YES];

崩溃的代码位置
image

@liuhaijing-lab liuhaijing-lab added bug Something isn't working Needs: Triage 🔍 labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

1 participant