summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-06-06 22:50:00 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-06-06 22:50:00 +0100
commit273d3366805a7022ad99a58dba172954a363b895 (patch)
treeab36738eda1a55de963b73283f7b993d4249cd87
parentMove the parameter stack into ExecContext too (diff)
downloadproject2-273d3366805a7022ad99a58dba172954a363b895.tar.bz2
project2-273d3366805a7022ad99a58dba172954a363b895.tar.xz
project2-273d3366805a7022ad99a58dba172954a363b895.zip
Non-static ICE proxy and destroy the local communicator handle
-rw-r--r--project2/common/dataSource.cpp4
-rw-r--r--project2/common/dataSource.h2
-rw-r--r--project2/ice/iceDataSource.cpp7
-rw-r--r--project2/ice/iceDataSource.h3
-rw-r--r--project2/ice/unittests/testDaemon.cpp1
5 files changed, 9 insertions, 8 deletions
diff --git a/project2/common/dataSource.cpp b/project2/common/dataSource.cpp
index 133f64d..b5760c5 100644
--- a/project2/common/dataSource.cpp
+++ b/project2/common/dataSource.cpp
@@ -7,7 +7,3 @@ DataSource::DataSource(ScriptNodePtr p) :
{
}
-DataSource::~DataSource()
-{
-}
-
diff --git a/project2/common/dataSource.h b/project2/common/dataSource.h
index 063d33e..bd7170f 100644
--- a/project2/common/dataSource.h
+++ b/project2/common/dataSource.h
@@ -11,7 +11,7 @@ typedef boost::intrusive_ptr<DataSource> DataSourcePtr;
class DataSource : public SourceObject {
public:
DataSource(ScriptNodePtr p);
- virtual ~DataSource();
+ virtual ~DataSource() = default;
virtual void close() { };
virtual void commit() { };
diff --git a/project2/ice/iceDataSource.cpp b/project2/ice/iceDataSource.cpp
index 7871500..aa033fc 100644
--- a/project2/ice/iceDataSource.cpp
+++ b/project2/ice/iceDataSource.cpp
@@ -7,7 +7,6 @@
#include "appInstance.h"
IceBase::Libs IceDataSource::libs;
-IceDataSource::Proxies IceDataSource::proxies;
DECLARE_OPTIONS(IceDataSource, "ICE Data Source")
("ice.client.slice", Options::functions(boost::bind(&IceBase::SetSlice, boost::ref(IceDataSource::libs), &IceDataSource::GetComponentCompiler, _1, true, true), boost::bind(&IceDataSource::ClearSlice)),
@@ -27,6 +26,11 @@ IceDataSource::IceDataSource(ScriptNodePtr p) :
Logger()->messagebf(LOG_DEBUG, "%s: endpoint: %s", __PRETTY_FUNCTION__, endpoint(NULL));
}
+IceDataSource::~IceDataSource()
+{
+ ic->destroy();
+}
+
IceCompile::Ptr
IceDataSource::GetComponentCompiler(const std::string & slice, const IceCompile::Deps & deps)
{
@@ -38,7 +42,6 @@ IceDataSource::ClearSlice()
{
AppInstance::current().clearScriptCache();
libs.clear();
- proxies.clear();
}
class IceDataSourceLoader : public ElementLoader::For<IceDataSource> {
diff --git a/project2/ice/iceDataSource.h b/project2/ice/iceDataSource.h
index fa0c92a..715f27b 100644
--- a/project2/ice/iceDataSource.h
+++ b/project2/ice/iceDataSource.h
@@ -12,6 +12,7 @@ class IceDataSource : public DataSource, IceBase {
INITOPTIONS;
IceDataSource(ScriptNodePtr p);
+ ~IceDataSource();
template <typename Interface>
Interface GetProxy(const std::string object, ExecContext * ec) const
@@ -35,7 +36,7 @@ class IceDataSource : public DataSource, IceBase {
const Ice::CommunicatorPtr ic;
typedef std::map<std::string, Ice::ObjectPrx> Proxies;
- static Proxies proxies;
+ mutable Proxies proxies;
};
#endif
diff --git a/project2/ice/unittests/testDaemon.cpp b/project2/ice/unittests/testDaemon.cpp
index 3ca9261..0740966 100644
--- a/project2/ice/unittests/testDaemon.cpp
+++ b/project2/ice/unittests/testDaemon.cpp
@@ -186,6 +186,7 @@ commonTests()
id->shutdown();
run.join();
+ ic->destroy();
}
static