summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-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;