summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2010-03-22 03:57:52 +0000
committerAndrew Stitcher <astitcher@apache.org>2010-03-22 03:57:52 +0000
commit523c7d10c922fc442f1e0efe6cf91491ff257647 (patch)
treed3b4de550f0d2d8bac26bfe3c16a31c4e5538585 /cpp
parentc8a18f698439746d0bb5e9fda1dec47ff34822df (diff)
downloadqpid-python-523c7d10c922fc442f1e0efe6cf91491ff257647.tar.gz
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 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@925949 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp
index cb9df8e60f..ec1f4584db 100644
--- a/cpp/src/qpid/client/ConnectionImpl.cpp
+++ b/cpp/src/qpid/client/ConnectionImpl.cpp
@@ -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;