summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yqueue.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/yqueue.hpp b/src/yqueue.hpp
index f20ac4c..f80af9c 100644
--- a/src/yqueue.hpp
+++ b/src/yqueue.hpp
@@ -60,11 +60,13 @@ namespace zmq
inline ~yqueue_t ()
{
while (true) {
+ if (begin_chunk == end_chunk) {
+ delete begin_chunk;
+ break;
+ }
chunk_t *o = begin_chunk;
begin_chunk = begin_chunk->next;
delete o;
- if (o == end_chunk)
- break;
}
}