Showing the changes to libraries/script-engine/src/Scriptable.cpp (1 of 18 files). Show all
Unified · Split
| @@ -11,14 +11,12 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include "Scriptable.h" |
| 13 | 13 | |
| 14 | −#include <QtCore/QThreadStorage> | |
| 15 | − | |
| 16 | −static QThreadStorage<ScriptContext*> ScriptContextStore; | |
| 14 | +static thread_local ScriptContext* ScriptContextStore; | |
| 17 | 15 | |
| 18 | 16 | ScriptContext* Scriptable::context() { |
| 19 | − return ScriptContextStore.localData(); | |
| 17 | + return ScriptContextStore; | |
| 20 | 18 | } |
| 21 | 19 | |
| 22 | 20 | void Scriptable::setContext(ScriptContext* context) { |
| 23 | − ScriptContextStore.setLocalData(context); | |
| 21 | + ScriptContextStore = context; | |
| 24 | 22 | } |