activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1088791 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp
Date Mon, 04 Apr 2011 21:03:53 GMT
Author: tabish
Date: Mon Apr  4 21:03:53 2011
New Revision: 1088791

URL: http://svn.apache.org/viewvc?rev=1088791&view=rev
Log:
Do a manual unregister of WireFormat and Transport factories on library shutdown instead of
letting the registery destructor handle it, this prevents leak checkers like valgrind from
mistakenly reporting memory leaks.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp?rev=1088791&r1=1088790&r2=1088791&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp Mon
Apr  4 21:03:53 2011
@@ -67,6 +67,16 @@ void ActiveMQCPP::shutdownLibrary() {
     // Shutdown the IdGenerator Kernel
     IdGenerator::shutdown();
 
+    // Clear out all registered WireFormat Factories.
+    WireFormatRegistry::getInstance().unregisterFactory("openwire");
+    WireFormatRegistry::getInstance().unregisterFactory("stomp");
+
+    // Clear out all regsitered Transport factories
+    TransportRegistry::getInstance().unregisterFactory("tcp");
+    TransportRegistry::getInstance().unregisterFactory("ssl");
+    TransportRegistry::getInstance().unregisterFactory("mock");
+    TransportRegistry::getInstance().unregisterFactory("failover");
+
     // Now it should be safe to shutdown Decaf.
     decaf::lang::Runtime::shutdownRuntime();
 }



Mime
View raw message