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
commita9f5a628ac22bfdae5ce4cc5913df989cd8fe7f4 (patch)
treed3b4de550f0d2d8bac26bfe3c16a31c4e5538585 /cpp
parentb82a2394177f08dedb87a70c33797d9a3e20e586 (diff)
downloadqpid-python-a9f5a628ac22bfdae5ce4cc5913df989cd8fe7f4.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;