在获取弹幕时抛异常后尝试关闭数据库
This commit is contained in:
parent
52e4312a32
commit
3f10e19e50
@ -89,6 +89,7 @@ public class LiveDanmuService {
|
||||
public LiveVideoDanmu getDanmu(String roomId, String videoId, int page) {
|
||||
LiveVideoDanmu danmus = new LiveVideoDanmu();
|
||||
BiliLiveDatabase liveDatabase = new BiliLiveDatabase(LiveRoomConfig.buildConfig(roomId));
|
||||
try {
|
||||
LiveVideoDatabaseBean videoBean = liveDatabase.getVideo(videoId);
|
||||
if (videoBean == null) {
|
||||
return new LiveVideoDanmu();
|
||||
@ -118,7 +119,12 @@ public class LiveDanmuService {
|
||||
danmus.getSuperChat().add(superChat);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e(e);
|
||||
} finally {
|
||||
liveDatabase.close();
|
||||
}
|
||||
|
||||
return danmus;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user