Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Commit 6830476

Browse files
committed
Fixed uncalled destructors on destruction of queue
1 parent 073fafb commit 6830476

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

events.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ int equeue_create_inplace(struct equeue *q, unsigned size, void *buffer) {
4848
}
4949

5050
void equeue_destroy(struct equeue *q) {
51+
while (q->queue) {
52+
struct event *e = q->queue;
53+
q->queue = e->next;
54+
event_dealloc(q, e+1);
55+
}
56+
5157
events_mutex_destroy(&q->freelock);
5258
events_mutex_destroy(&q->queuelock);
5359
events_sema_destroy(&q->eventsema);

0 commit comments

Comments
 (0)