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

QMUIModalPresentationWindow没释放 #1525

Open
weidongliu opened this issue Sep 14, 2023 · 2 comments
Open

QMUIModalPresentationWindow没释放 #1525

weidongliu opened this issue Sep 14, 2023 · 2 comments

Comments

@weidongliu
Copy link

Bug 表现
QMUIModalPresentationWindow没释放

截图
image

如何重现
使用QMUIAlertController弹窗后关闭

预期的表现
QMUIModalPresentationWindow释放掉

其他信息

  • Xcode 版本: [Xcode 14.3.1]
  • QMUI 版本: [4.4.3]
@RomanticEncounter
Copy link

是不是你在contentViewBlock中引用了QMUIModalPresentationViewController,你可以将QMUIModalPresentationViewController弱引用,例如:

@weakify(modalViewController)
contentView.completeHandler = ^{
    @strongify(modalViewController)
    [modalViewController hideWithAnimated:YES completion:^(BOOL finished) {
        if (finished) {
            completeHandler();
        }
    }];
};

@weidongliu
Copy link
Author

@RomanticEncounter 没有噢,我都没主动调用到QMUIModalPresentationViewController,使用方法就是这样
let controller = QMUIAlertController(title: nil, message: message, preferredStyle: .alert)
controller.showWith(animated: true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants