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

老板,内存泄漏了 #436

Closed
NerdAnonymous opened this issue Apr 16, 2019 · 18 comments
Closed

老板,内存泄漏了 #436

NerdAnonymous opened this issue Apr 16, 2019 · 18 comments

Comments

@NerdAnonymous
Copy link

Instance of com.yanzhenjie.permission.bridge.RequestExecutor 就是这个线程造成的

@YouthLee
Copy link

我也遇到这个问题

@LwkCoder
Copy link

我也遇到

1 similar comment
@qsny
Copy link

qsny commented Apr 26, 2019

我也遇到

@qsny
Copy link

qsny commented Apr 26, 2019

求解决啊老板

@xiakehe
Copy link

xiakehe commented May 16, 2019

求解决啊

@ShinyZeng
Copy link

RequestExecutor

    @Override
    public void onCallback() {
        synchronized (this) {
            mMessenger.unRegister();
            mRequest.getCallback().onCallback();
            // fix memory leak 
            mMessenger = null;
            mRequest = null;
            notify();
        }
    }

mMessage 和 mRequest 持有了Context ,后续没有权限请求之后没有置空导致的泄漏,这里置空解决。
老板看下这样解决行不行

@haonan1
Copy link

haonan1 commented Jul 2, 2019

求解决

@mambahao
Copy link

+1

@Erichkko
Copy link

2.0.2版本大概什么时候Release呢

1 similar comment
@xiakehe
Copy link

xiakehe commented Aug 20, 2019

2.0.2版本大概什么时候Release呢

@Roben1016
Copy link

2.0.2版本大概什么时候Release

@BrightVan
Copy link

感觉差不多就可以发一版了,这个内存泄露老是出来。

@YuanTiger
Copy link

我也遇到了这个内存泄漏,请问v2.0.2的Release大概什么时候发布呢?
感谢大大的无私开源!

@sweet2o09
Copy link

mark一下,期待2.0.2版本严大神的开源库还是挺不错的

@yqyzxd
Copy link

yqyzxd commented Oct 18, 2019

2.0.3版本依然报出这个问题

@lujun525
Copy link

lujun525 commented Jun 4, 2020

作者你好,我用的是2.0.1的support包,加了 mMessenger = null;mRequest = null;这两行代码,可是还是报内存泄露,啥原因啊

@lujun525
Copy link

lujun525 commented Jun 4, 2020

RequestExecutor

    @Override
    public void onCallback() {
        synchronized (this) {
            mMessenger.unRegister();
            mRequest.getCallback().onCallback();
            // fix memory leak 
            mMessenger = null;
            mRequest = null;
            notify();
        }
    }

mMessage 和 mRequest 持有了Context ,后续没有权限请求之后没有置空导致的泄漏,这里置空解决。
老板看下这样解决行不行

这样加了,我看还是会报呢

@lujun525
Copy link

lujun525 commented Jun 4, 2020

我改了两处,一个onCallback处mMessenger = null; mRequest = null; 另一个 mMessenger = new Messenger(mRequest.getSource().getContext(), this);改成mMessenger = new Messenger(mRequest.getSource().getContext().getApplicationContext(), this); 现在是没有泄露了,试了下这两处少任何一处都会有内存泄露,不知道为啥要改第二处

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

No branches or pull requests