mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-28 12:47:43 +00:00
Fix potential concurrency issue
Made the registeredPlugins list CoW since there are multiple threads iterating and modifying it, potentially at the same time.
This commit is contained in:
parent
6379679e2b
commit
320befcf36
@ -28,6 +28,7 @@ import java.net.MalformedURLException
|
||||
import java.net.URL
|
||||
import java.net.URLDecoder
|
||||
import java.security.MessageDigest
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
/**
|
||||
* Handles the cache for album art
|
||||
@ -67,7 +68,7 @@ internal object AlbumArtCache {
|
||||
/**
|
||||
* A list of plugins to notify on fetched album art
|
||||
*/
|
||||
private val registeredPlugins = ArrayList<MprisPlugin>()
|
||||
private val registeredPlugins = CopyOnWriteArrayList<MprisPlugin>()
|
||||
|
||||
/**
|
||||
* Initializes the disk cache. Needs to be called at least once before trying to use the cache
|
||||
|
Loading…
x
Reference in New Issue
Block a user