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 | #include "Scriptable.h" | 12 | #include "Scriptable.h" |
| 13 | 13 | ||
| 14 | #include <QtCore/QThreadStorage> | 14 | static thread_local ScriptContext* ScriptContextStore; |
| 15 | |||
| 16 | static QThreadStorage<ScriptContext*> ScriptContextStore; | ||
| 17 | 15 | ||
| 18 | ScriptContext* Scriptable::context() { | 16 | ScriptContext* Scriptable::context() { |
| 19 | return ScriptContextStore.localData(); | 17 | return ScriptContextStore; |
| 20 | } | 18 | } |
| 21 | 19 | ||
| 22 | void Scriptable::setContext(ScriptContext* context) { | 20 | void Scriptable::setContext(ScriptContext* context) { |
| 23 | ScriptContextStore.setLocalData(context); | 21 | ScriptContextStore = context; |
| 24 | } | 22 | } |