Author: astitcher
Date: Mon Mar 22 03:57:52 2010
New Revision: 925949

URL: http://svn.apache.org/viewvc?rev=925949&view=rev
Log:
Make sure the client library Poller is created on library load before anything 
in the
client program can be run. This ensures that it will be destroyed after 
anything in
the client program is destroyed

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp?rev=925949&r1=925948&r2=925949&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp Mon Mar 22 03:57:52 
2010
@@ -134,6 +134,15 @@ IOThread& theIO() {
     return io;
 }
 
+// Bring theIO into existence on library load rather than first use.
+// This avoids it being destroyed whilst something in the main program
+// still exists
+struct InitAtLoad {
+    InitAtLoad() {
+        (void) theIO();
+    }
+} init;
+
 class HeartbeatTask : public TimerTask {
     TimeoutHandler& timeout;
 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to