You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2010/03/22 04:57:52 UTC

svn commit: r925949 - /qpid/trunk/qpid/cpp/src/qpid/client/ConnectionImpl.cpp

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:commits-subscribe@qpid.apache.org