From 6d51452c555dbc2e086f1ceff7a1859f1d9bf9eb Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 16 Feb 2012 10:08:51 +0900 Subject: Bug fixed in context termination Signed-off-by: Martin Sustrik --- src/ctx.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3