Skip to content

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

@houyinyu

Description

@houyinyu

建议在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;
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions