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

内存泄漏 #16

Open
GitHubKlod opened this issue Jan 20, 2022 · 3 comments
Open

内存泄漏 #16

GitHubKlod opened this issue Jan 20, 2022 · 3 comments

Comments

@GitHubKlod
Copy link

Rewardlayout.mContext 内存泄露

@Yuphee
Copy link
Owner

Yuphee commented Jan 20, 2022 via email

@GitHubKlod
Copy link
Author

GitHubKlod commented Jan 20, 2022

com.zhangyf.gift.RewardLayout
instance
Leaking: YES (View.mContextreferences a destroyed activity)Retaining 7.5 MB in 8055 objectsView is part of a window viewhierarchy
View.mAttachInfo is null (viewdetached)
View.mID = R.id.Ilgiftcontent
View.mWindowAttachCount = 1
mContext instance of LiveRoomActivity with mDestroyed = true
View.mContext

@GitHubKlod
Copy link
Author

在onDestory里
if (rewardLayout != null) {

        rewardLayout.onDestroy();
        rewardLayout = null;
    }

再加个 赋值null 就没发现泄漏了

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