From a0a756b788cad647a0b8a4c29fd23b11d0bc2d29 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 1 Dec 2014 16:36:13 +0000 Subject: Clear script caches before libraries are unloaded --- project2/basics/options/preload.cpp | 2 ++ project2/common/scripts.cpp | 6 ++++++ project2/common/scripts.h | 1 + project2/ice/iceDaemon.cpp | 2 ++ project2/ice/iceDataSource.cpp | 2 ++ 5 files changed, 13 insertions(+) diff --git a/project2/basics/options/preload.cpp b/project2/basics/options/preload.cpp index 006391d..b3c126e 100644 --- a/project2/basics/options/preload.cpp +++ b/project2/basics/options/preload.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ class Preload { static void UnloadLibraries() { + ScriptReader::clearCache(); libs.clear(); } diff --git a/project2/common/scripts.cpp b/project2/common/scripts.cpp index 2b52db5..8801841 100644 --- a/project2/common/scripts.cpp +++ b/project2/common/scripts.cpp @@ -67,6 +67,12 @@ ScriptReader::load(const CommonObjects * co, bool childrenOnly) const loader.collectAll(co, childrenOnly, root()); } +void +ScriptReader::clearCache() +{ + scriptCache.clear(); +} + ScriptReaderPtr ScriptReader::resolveScript(const std::string & group, const std::string & name, bool ii) { diff --git a/project2/common/scripts.h b/project2/common/scripts.h index 7d43a01..775a080 100644 --- a/project2/common/scripts.h +++ b/project2/common/scripts.h @@ -73,6 +73,7 @@ class ScriptReader : public virtual IntrusivePtrBase { mutable LoaderBase loader; static ScriptReaderPtr resolveScript(const std::string & group, const std::string & name, bool ii); + static void clearCache(); friend class SourceObject; mutable std::map namedComponents; diff --git a/project2/ice/iceDaemon.cpp b/project2/ice/iceDaemon.cpp index 7f506d4..b9211f9 100644 --- a/project2/ice/iceDaemon.cpp +++ b/project2/ice/iceDaemon.cpp @@ -3,6 +3,7 @@ #include "buildComms.h" #include "buildDaemon.h" #include "iceViewSerializer.h" +#include #include #include #include @@ -180,6 +181,7 @@ IceDaemon::GetComponentCompiler(const std::string & slice, const IceCompile::Dep void IceDaemon::ClearSlice() { + ScriptReader::clearCache(); libs.clear(); } diff --git a/project2/ice/iceDataSource.cpp b/project2/ice/iceDataSource.cpp index c3d5b36..1b0c9e8 100644 --- a/project2/ice/iceDataSource.cpp +++ b/project2/ice/iceDataSource.cpp @@ -1,6 +1,7 @@ #include #include "buildClient.h" #include "iceDataSource.h" +#include #include IceBase::Libs IceDataSource::libs; @@ -33,6 +34,7 @@ IceDataSource::GetComponentCompiler(const std::string & slice, const IceCompile: void IceDataSource::ClearSlice() { + ScriptReader::clearCache(); libs.clear(); proxies.clear(); } -- cgit v1.2.3