wzgiceman / RxjavaRetrofitDemo-master

Retrofit+Rxjava+okhttp终极封装(Gson方案)
http://blog.csdn.net/column/details/13297.html
MIT License
1.06k stars 290 forks source link

内存溢出问题 #32

Open TonyEasy opened 6 years ago

TonyEasy commented 6 years ago

public void doHttpDeal(BaseApi basePar) { /链接式对象返回/ SoftReference httpOnNextListener = basePar.getListener(); if (httpOnNextListener != null && httpOnNextListener.get() != null) { httpOnNextListener.get().onNext(observable); }

    /*数据回调*/
    observable.subscribe(subscriber);
}

每次的网络请求都会产生一次订阅关系,如何才能使接口回调回来后,取消本次订阅?

TonyEasy commented 6 years ago

对比其它框架,大神你的retrofit占内存比较高

wzgiceman commented 6 years ago

这个地方是有兄弟提出需要链接式返回才写的,个人并不推荐使用;如果不需要可以直接去掉这里,内存较高主要是ProgressDialog是集成在封装里,所以比其他的Retorift高一点;