summaryrefslogtreecommitdiff
path: root/src/ctx.cpp
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2011-05-13 12:43:09 +0200
committerMartin Lucina <martin@lucina.net>2012-01-23 08:53:59 +0100
commitad3e013f74d309b86e8f087932203e5787fe2d2d (patch)
treea872da7e7338a0bb27b92ef1f198689873b86978 /src/ctx.cpp
parentf34d1599a651dd0b8feba2397f87629733988384 (diff)
parentb593ea30833ad5dcacb9076c988aec31b0cf26ec (diff)
Imported Debian patch 2.1.7-1debian/2.1.7-1
Diffstat (limited to 'src/ctx.cpp')
-rw-r--r--src/ctx.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp
index 9cbb9de..2758729 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -36,6 +36,7 @@
#endif
zmq::ctx_t::ctx_t (uint32_t io_threads_) :
+ tag (0xbadcafe0),
terminating (false)
{
int rc;
@@ -78,6 +79,11 @@ zmq::ctx_t::ctx_t (uint32_t io_threads_) :
zmq_assert (rc == 0);
}
+bool zmq::ctx_t::check_tag ()
+{
+ return tag == 0xbadcafe0;
+}
+
zmq::ctx_t::~ctx_t ()
{
// Check that there are no remaining sockets.
@@ -99,6 +105,9 @@ zmq::ctx_t::~ctx_t ()
// needed as mailboxes themselves were deallocated with their
// corresponding io_thread/socket objects.
free (slots);
+
+ // Remove the tag, so that the object is considered dead.
+ tag = 0xdeadbeef;
}
int zmq::ctx_t::terminate ()