Showing the changes to libraries/script-engine/src/ScriptCache.cpp (1 of 3 files). Show all
Unified · Split
| @@ -36,6 +36,19 @@ void ScriptCache::clearCache() { · 35 unmodified lines | |||
| 36 | _scriptCache.clear(); | 36 | _scriptCache.clear(); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void ScriptCache::clearATPScriptsFromCache() { | ||
| 40 | Lock lock(_containerLock); | ||
| 41 | qDebug(scriptengine) << "Clearing ATP scripts from ScriptCache"; | ||
| 42 | for (auto it = _scriptCache.begin(); it != _scriptCache.end();) { | ||
| 43 | if (it.key().scheme() == "atp") { | ||
| 44 | qDebug(scriptengine) << "Removing: " << it.key(); | ||
| 45 | it = _scriptCache.erase(it); | ||
| 46 | } else { | ||
| 47 | ++it; | ||
| 48 | } | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 39 | QString ScriptCache::getScript(const QUrl& unnormalizedURL, ScriptUser* scriptUser, bool& isPending, bool reload) { | 52 | QString ScriptCache::getScript(const QUrl& unnormalizedURL, ScriptUser* scriptUser, bool& isPending, bool reload) { |
| 40 | QUrl url = ResourceManager::normalizeURL(unnormalizedURL); | 53 | QUrl url = ResourceManager::normalizeURL(unnormalizedURL); |
| 41 | QString scriptContents; | 54 | QString scriptContents; |