summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/ConnectionImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp
index 05a781c2d9..b6043518e8 100644
--- a/cpp/src/qpid/client/ConnectionImpl.cpp
+++ b/cpp/src/qpid/client/ConnectionImpl.cpp
@@ -137,15 +137,6 @@ 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;
@@ -164,6 +155,13 @@ public:
}
+// Ensure the IO threads exist:
+// This needs to be called in the Connection constructor
+// so that they will still exist at last connection destruction
+void ConnectionImpl::init() {
+ (void) theIO();
+}
+
ConnectionImpl::ConnectionImpl(framing::ProtocolVersion v, const ConnectionSettings& settings)
: Bounds(settings.maxFrameSize * settings.bounds),
handler(settings, v),