summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-06-05 20:49:26 +0200
committerBenoit Foucher <benoit@zeroc.com>2014-06-05 20:49:26 +0200
commitbe5f41f8ffd74f2651b1db1a61badfd41f17a36d (patch)
treeb94687eaeb0f0024be247ef07efe7541b7d813b2 /cpp/src/Ice/Instance.cpp
parentFixed ICE-5490: selector doesn't check for EPOLLERR on Linux (diff)
downloadice-be5f41f8ffd74f2651b1db1a61badfd41f17a36d.tar.bz2
ice-be5f41f8ffd74f2651b1db1a61badfd41f17a36d.tar.xz
ice-be5f41f8ffd74f2651b1db1a61badfd41f17a36d.zip
Fixed ICE-5499, new garbage collection support
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 193ca7fc37e..4adfe45e021 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -36,7 +36,6 @@
#include <IceUtil/StringUtil.h>
#include <Ice/PropertiesI.h>
#include <Ice/Communicator.h>
-#include <Ice/GC.h>
#include <Ice/MetricsAdminI.h>
#include <Ice/InstrumentationI.h>
#include <Ice/ProtocolInstance.h>
@@ -81,13 +80,6 @@ extern bool ICE_DECLSPEC_IMPORT printStackTraces;
};
-namespace IceInternal
-{
-
-extern IceUtil::Handle<IceInternal::GC> theCollector;
-
-}
-
namespace
{
@@ -836,6 +828,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_state(StateActive),
_initData(initData),
_messageSizeMax(0),
+ _collectObjects(false),
_implicitContext(0),
_stringConverter(IceUtil::getProcessStringConverter()),
_wstringConverter(IceUtil::getProcessWstringConverter())
@@ -1048,6 +1041,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
}
}
+ const_cast<bool&>(_collectObjects) = _initData.properties->getPropertyAsInt("Ice.CollectObjects") > 0;
+
//
// Client ACM enabled by default. Server ACM disabled by default.
//
@@ -1245,7 +1240,6 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
//
if(_observer)
{
- theCollector->updateObserver(_observer);
_observer->setObserverUpdater(new ObserverUpdaterI(this));
}
@@ -1354,7 +1348,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
}
}
-bool
+void
IceInternal::Instance::destroy()
{
{
@@ -1366,7 +1360,7 @@ IceInternal::Instance::destroy()
//
if(_state != StateActive)
{
- return false;
+ return;
}
//
@@ -1403,11 +1397,6 @@ IceInternal::Instance::destroy()
_retryQueue->destroy();
}
- if(_observer && theCollector)
- {
- theCollector->clearObserver(_observer);
- }
-
if(_metricsAdmin)
{
_metricsAdmin->destroy();
@@ -1530,7 +1519,6 @@ IceInternal::Instance::destroy()
}
}
}
- return true;
}
void
@@ -1567,8 +1555,6 @@ IceInternal::Instance::updateThreadObservers()
{
_endpointHostResolver->updateObserver();
}
- assert(theCollector);
- theCollector->updateObserver(_observer);
}
catch(const Ice::CommunicatorDestroyedException&)
{