aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/message_queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/svm/message_queue.c')
-rw-r--r--src/svm/message_queue.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/svm/message_queue.c b/src/svm/message_queue.c
index e08ba06fb27..a6af7962f73 100644
--- a/src/svm/message_queue.c
+++ b/src/svm/message_queue.c
@@ -167,10 +167,19 @@ svm_msg_q_attach (svm_msg_q_t *mq, void *smq_base)
}
void
+svm_msg_q_cleanup (svm_msg_q_t *mq)
+{
+ vec_free (mq->rings);
+ clib_spinlock_free (&mq->q.lock);
+ if (mq->q.evtfd != -1)
+ close (mq->q.evtfd);
+}
+
+void
svm_msg_q_free (svm_msg_q_t * mq)
{
+ svm_msg_q_cleanup (mq);
clib_mem_free (mq->q.shr);
- clib_spinlock_free (&mq->q.lock);
clib_mem_free (mq);
}