[scripting] Avoid threading issues when loading from a file
ClosedPublic

Authored by davidedmundson on Jan 9 2019, 3:50 PM.

Details

Summary

KWin::Script::loadScriptFromFile ran in it's own thread and accessed
member variables of KWin::Script without any guards.

Potentially script could be destroyed whilst the file is loading.

Rather than adding mutexes everywhere, this patch scopes the QFile
object to be local to the threaded function making it independent.

BUG: 403038

Test Plan

Ran a script from a file

Diff Detail

Repository
R108 KWin
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6862
Build 6880: arc lint + arc unit
davidedmundson created this revision.Jan 9 2019, 3:50 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 9 2019, 3:50 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Jan 9 2019, 3:50 PM
graesslin accepted this revision.Jan 9 2019, 5:24 PM
This revision is now accepted and ready to land.Jan 9 2019, 5:24 PM
This revision was automatically updated to reflect the committed changes.