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

避免maskView导致的内存泄露 #337

Open
houyinyu opened this issue Jun 18, 2023 · 1 comment
Open

避免maskView导致的内存泄露 #337

houyinyu opened this issue Jun 18, 2023 · 1 comment

Comments

@houyinyu
Copy link

houyinyu commented Jun 18, 2023

建议在BottomDialog的 removeMaskView() 方法中,移除maskView和异常后对maskView置空,避免内存泄露:

        if (maskView == null) {
            DialogLog.print("mask view is null");
            return;
        }
        try {
            activity.getWindowManager().removeViewImmediate(maskView);
            maskView=null;
            DialogLog.print("dialog remove mask view");
        } catch (Throwable e) {
            //...not attached to window manager
            // Activity ...... has leaked window android.view.View
            DialogLog.print(e);
            maskView=null;
        }
    }
liyujiang-gzu added a commit that referenced this issue Jul 17, 2023
@liyujiang-gzu
Copy link
Member

@houyinyu 已发布 4.1.12 版本

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