Comments (7)
这样改没有问题。
不过有点奇怪如果JsonSource的实例被回收,他的成员应该也会被回收的,JsonSource在BaseDanmakuParser里的parse()之后已经release并且置null, 为什么mJSONArray没有被一起回收呢
from danmakuflamemaster.
你是如何得知“jsonArray并没有被回收掉”
from danmakuflamemaster.
当我的视频播放的fragment被remove后,查看内存,发现弹幕的相应数据还存在内存中,弹幕的release方法有调用,具体的还没有分析清楚,但看起来像是DanmakuLoader在持有mJsonArray的引用:
from danmakuflamemaster.
请帮忙看下是不是这样,AcFunDanmakuLoader的instance持有JSONSource dataSource对象,在JSONSource中,release后,mJSONArray并没有被回收,而AcFunDanmakuLoader的instance对象不会被回收,最终导致了mJSONArray不能被回收。
from danmakuflamemaster.
补一张我在release中将mJsonArray置为null后的内存,可以看见,AcFunDanmakuLoader依旧存在内存中,但是mJsonArray因为已经被回收,所以AcFunDanmakuLoader对象已经不占用内存。我怀疑跟fragment有关,如果是activity中应该不存在此问题。
from danmakuflamemaster.
应该是静态变量instance的问题
from danmakuflamemaster.
提交个pull request 吧
from danmakuflamemaster.
Related Issues (20)
- 多次进入退出弹幕页面崩溃
- 自定义数据解析器,不显示弹幕,急求,谢谢 HOT 2
- padding可否加上设置左上右下,我看源码只能共用padding,不太灵活
- 使用DanmakuTextureView的实现无法显示弹幕
- #00 pc 00000f9c /data/data/com.liqiang365app.musen/app_p_n/1249074292/libndkbitmap.so (createSkBitmap(ndkbitmap_object_t*, int, int, int)+19) [armeabi-v5te]
- 如何实时修改字体大小,颜色等 HOT 1
- 弹幕底部出现小白点
- DrawHandler cause Choreographer.mDisplayEventReceiver leak
- 空指针了Attempt to invoke virtual method 'void androidx.constraintlayout.solver.widgets.ConstraintWidget.n0()' on a null object reference
- Fuckboy HOT 1
- ViewCacheStuffer 只回调create,不回调bindviewholder
- 横竖屏切换后,弹幕会从头开始滚动且会出现重叠的情况 HOT 1
- 使用DanmakuViewHolder自定义样式会出现偶尔重复,偶尔鬼畜
- 弹幕库不维护了吗?有其他库可以使用吗? HOT 4
- jcenter关闭了 这个库该怎么用 HOT 1
- ViewCacheStuffer运行一段时间后,所有itemView的长度都相等了,itemView会有显示不全的情况
- libndkbitmap.so异常 HOT 1
- 开发者一定以前一定是搞游戏开发的 HOT 1
- 弹幕点击悬停是怎么实现的
- 部分机型点击弹幕没有回调 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from danmakuflamemaster.