summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:08:51 +0900
committerMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:08:51 +0900
commit6d51452c555dbc2e086f1ceff7a1859f1d9bf9eb (patch)
tree94331e2aa79afab5524cd39bb3284d584383b30b /src
parentda930314aafc6cc7b182f0bbfa8e06c0b743e62d (diff)
Bug fixed in context termination
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src')
-rw-r--r--src/ctx.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ctx.cpp b/src/ctx.cpp
index c80a3c3..a8df950 100644
--- a/src/ctx.cpp
+++ b/src/ctx.cpp
@@ -42,6 +42,11 @@ xs::ctx_t::ctx_t (uint32_t io_threads_) :
tag (0xbadcafe0),
starting (true),
terminating (false),
+ reaper (NULL),
+ slot_count (0),
+ slots (NULL),
+ monitor (NULL),
+ log_socket (NULL),
max_sockets (512),
io_thread_count (io_threads_),
reentrant (false)
@@ -68,12 +73,14 @@ xs::ctx_t::~ctx_t ()
delete io_threads [i];
// Deallocate the reaper thread object.
- delete reaper;
+ if (reaper)
+ delete reaper;
// Deallocate the array of mailboxes. No special work is
// needed as mailboxes themselves were deallocated with their
// corresponding io_thread/socket objects.
- free (slots);
+ if (slots)
+ free (slots);
// Remove the tag, so that the object is considered dead.
tag = 0xdeadbeef;