Skip to content

Commit daa00bd

Browse files
committed
Merge pull request #6 from bug-buster/master
Fix the singleton in ZmqContext::instance
2 parents 858e5ba + a79b6c3 commit daa00bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ZmqContext.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class ZmqContext
1010
ZmqContext(int iothreads, int defaultLinger);
1111
~ZmqContext();
1212
static ZmqContext *instance(int iothreads=4, int defaultLinger = 0) {
13-
return self_ ? self_ : new ZmqContext(iothreads, defaultLinger);
13+
if (!self_)
14+
self_ = new ZmqContext(iothreads, defaultLinger);
15+
return self_;
1416
}
1517

1618
static int majorVersion();

0 commit comments

Comments
 (0)