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

Authored by davidedmundson on Wed, Jan 9, 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Wed, Jan 9, 3:50 PM
Restricted Application added a project: KWin. · View Herald TranscriptWed, Jan 9, 3:50 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Wed, Jan 9, 3:50 PM
graesslin accepted this revision.Wed, Jan 9, 5:24 PM
This revision is now accepted and ready to land.Wed, Jan 9, 5:24 PM
This revision was automatically updated to reflect the committed changes.