Fix: unsafe pointer while initializing unfinished aria2 task

This commit is contained in:
HFO4
2020-02-09 10:52:06 +08:00
parent d30159579f
commit 7a6c84a115
2 changed files with 26 additions and 22 deletions

View File

@@ -125,9 +125,10 @@ func Init() {
// 从数据库中读取未完成任务,创建监控
unfinished := model.GetDownloadsByStatus(Ready, Paused, Downloading)
for _, task := range unfinished {
for i := 0; i < len(unfinished); i++ {
// 创建任务监控
NewMonitor(&task)
NewMonitor(&unfinished[i])
}
}