BackgroundFinder runs in a separate thread, it uses a static QStringList cache
It's perfectly plausible that two BackgroundFinders threads could run at once
Details
Details
- Reviewers
mart - Group Reviewers
Plasma - Commits
- R120:52ceb2454be4: Add mutex round static member used in a thread
Old code didn't crash, it was a pure hypothetical.
Works as before
Diff Detail
Diff Detail
- Repository
- R120 Plasma Workspace
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
wallpapers/image/backgroundlistmodel.cpp | ||
---|---|---|
532 | Potentially it still can produce a crash, the function returns a reference to list, simultaneously read/write on list is race condition. So function can return a copy to static list for this function, then global variables or mutexes doesn't needed. |
Comment Actions
Very well spotted!
In this specific case it's probably fine as it's never modified after construction, but I'll change anyway.