From 82ab16f0eca2e1cd4f8897d7dea60d4dfe5526aa Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Fri, 6 Jan 2012 14:46:56 -0800 Subject: ICE-4701 - AsyncResult::getCommunicator returns null --- cpp/src/Ice/ConnectionFactory.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'cpp/src/Ice/ConnectionFactory.cpp') diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index ee201fd09cd..1d44f74d755 100755 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -120,6 +120,7 @@ IceInternal::OutgoingConnectionFactory::destroy() #endif _destroyed = true; + _communicator = 0; notifyAll(); } @@ -437,7 +438,9 @@ IceInternal::OutgoingConnectionFactory::flushAsyncBatchRequests(const Communicat } } -IceInternal::OutgoingConnectionFactory::OutgoingConnectionFactory(const InstancePtr& instance) : +IceInternal::OutgoingConnectionFactory::OutgoingConnectionFactory(const CommunicatorPtr& communicator, + const InstancePtr& instance) : + _communicator(communicator), _instance(instance), _reaper(new ConnectionReaper()), _destroyed(false), @@ -675,7 +678,8 @@ IceInternal::OutgoingConnectionFactory::createConnection(const TransceiverPtr& t throw Ice::CommunicatorDestroyedException(__FILE__, __LINE__); } - connection = new ConnectionI(_instance, _reaper, transceiver, ci.connector, ci.endpoint->compress(false), 0); + connection = new ConnectionI(_communicator, _instance, _reaper, transceiver, ci.connector, + ci.endpoint->compress(false), 0); } catch(const Ice::LocalException&) { @@ -1420,7 +1424,8 @@ IceInternal::IncomingConnectionFactory::message(ThreadPoolCurrent& current) try { - connection = new ConnectionI(_instance, _reaper, transceiver, 0, _endpoint, _adapter); + connection = new ConnectionI(_adapter->getCommunicator(), _instance, _reaper, transceiver, 0, _endpoint, + _adapter); } catch(const LocalException& ex) { @@ -1551,7 +1556,8 @@ IceInternal::IncomingConnectionFactory::initialize(const string& oaName) const_cast(_transceiver) = _endpoint->transceiver(const_cast(_endpoint)); if(_transceiver) { - ConnectionIPtr connection = new ConnectionI(_instance, _reaper, _transceiver, 0, _endpoint, _adapter); + ConnectionIPtr connection = new ConnectionI(_adapter->getCommunicator(), _instance, _reaper, _transceiver, + 0, _endpoint, _adapter); connection->start(0); _connections.insert(connection); } -- cgit v1.2.3