You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
}, disconnected: { [weak self] session in
Log("Websocket client disconnected.")
self?.connectedItems.removeAll { $0.session == session
}
guard let items = self?.connectedItems else { return }
self?.danmakus.removeAll { dm in
let remove = !items.contains(where: { $0.url == dm.url })
if remove {
dm.stop()
}
return remove
}
The line which contains self?.danmakus leads a high probability app crash if you open more than 2 IINA windows and close them all simultaneously by pressing keyboard Q.
The text was updated successfully, but these errors were encountered:
The fix PR is attached here. Already tested and verified on my M1 Mac.
The main reason for the crash is the multiple threads will send the disconnect event at same time but the list is not provide thread safety logic. There is a high probability of this happening when using the keyboard Q to exit multiple IINA windows.
As you might consider the crash also occurs when adding new elements to danmakus. Yes, in rare cases this can happen, so it is good to add this protection to loadNewDanmaku()
Please review my changes. If you have any questions, please reply and let me know. I will check this PR frequently recently.
BTW, I must say this is a very convenient app for watching live broadcasts! Use it every day and night!
I am very grateful to the author for his continuous updates over the years!
HttpServer
The line which contains
self?.danmakus
leads a high probability app crash if you open more than 2 IINA windows and close them all simultaneously by pressing keyboard Q.The text was updated successfully, but these errors were encountered: