You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/05/21 15:12:12 UTC

svn commit: r946997 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/transport/tcp/TcpTransport.cpp main/decaf/net/ssl/SSLContextSpi.cpp test/decaf/net/SocketFactoryTest.cpp

Author: tabish
Date: Fri May 21 13:12:12 2010
New Revision: 946997

URL: http://svn.apache.org/viewvc?rev=946997&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-140

Fix some errors where pointers to default factories were getting deleted which causes segfaults later in the tests.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/tcp/TcpTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLContextSpi.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketFactoryTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/tcp/TcpTransport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/tcp/TcpTransport.cpp?rev=946997&r1=946996&r2=946997&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/tcp/TcpTransport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/tcp/TcpTransport.cpp Fri May 21 13:12:12 2010
@@ -159,7 +159,7 @@ void TcpTransport::connect( const decaf:
 Socket* TcpTransport::createSocket() {
 
     try {
-        std::auto_ptr<SocketFactory> factory( SocketFactory::getDefault() );
+        SocketFactory* factory = SocketFactory::getDefault();
         return factory->createSocket();
     }
     DECAF_CATCH_RETHROW( IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLContextSpi.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLContextSpi.cpp?rev=946997&r1=946996&r2=946997&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLContextSpi.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/ssl/SSLContextSpi.cpp Fri May 21 13:12:12 2010
@@ -39,13 +39,14 @@ SSLContextSpi::~SSLContextSpi() {
 ////////////////////////////////////////////////////////////////////////////////
 SSLParameters* SSLContextSpi::providerGetSupportedSSLParameters() {
 
+    SocketFactory* factory = NULL;
+
     std::auto_ptr<SSLParameters> params( new SSLParameters() );
-    std::auto_ptr<SocketFactory> factory;
     std::auto_ptr<SSLSocket> socket;
 
     try{
 
-        factory.reset( SSLSocketFactory::getDefault() );
+        factory = SSLSocketFactory::getDefault();
 
         socket.reset( dynamic_cast<SSLSocket*>( factory->createSocket() ) );
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketFactoryTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketFactoryTest.cpp?rev=946997&r1=946996&r2=946997&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketFactoryTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketFactoryTest.cpp Fri May 21 13:12:12 2010
@@ -140,7 +140,7 @@ void SocketFactoryTest::test()
 
         Thread::sleep( 500 );
 
-        std::auto_ptr<SocketFactory> factory( SocketFactory::getDefault() );
+        SocketFactory* factory = SocketFactory::getDefault();
         std::auto_ptr<Socket> client( factory->createSocket( "127.0.0.1", SocketFactoryTest::DEFAULT_PORT ) );
 
         client->setSoLinger( false, 0 );
@@ -189,7 +189,7 @@ void SocketFactoryTest::testNoDelay()
 
         Thread::sleep( 40 );
 
-        std::auto_ptr<SocketFactory> factory( SocketFactory::getDefault() );
+        SocketFactory* factory = SocketFactory::getDefault();
         std::auto_ptr<Socket> client( factory->createSocket( "127.0.0.1", SocketFactoryTest::DEFAULT_PORT ) );
 
         client->setSoLinger( false, 0 );