Diffusion KWin ba7aecfe53d7

[scripting] Avoid threading issues when loading from a file

Authored by davidedmundson on Jan 9 2019, 7:40 PM.

Description

[scripting] Avoid threading issues when loading from a file

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

Reviewers: KWin, graesslin

Reviewed By: KWin, graesslin

Subscribers: kwin

Tags: KWin

Differential Revision: https://phabricator.kde.org/D18126

Details

Committed
davidedmundsonJan 9 2019, 11:37 PM
Reviewer
KWin
Differential Revision
D18126: [scripting] Avoid threading issues when loading from a file
Parents
R108:fbe219172a81: Drop XFixes include in cursor.cpp
Branches
Unknown
Tags
Unknown