summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/nxt_unit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index 2694de7d..b7ac9b61 100644
--- a/src/nxt_unit.c
+++ b/src/nxt_unit.c
@@ -2728,14 +2728,20 @@ nxt_unit_done(nxt_unit_ctx_t *ctx)
} nxt_queue_loop;
for ( ;; ) {
+ pthread_mutex_lock(&lib->mutex);
+
process = nxt_unit_process_pop_first(lib);
if (process == NULL) {
+ pthread_mutex_unlock(&lib->mutex);
+
break;
}
nxt_unit_remove_process(ctx, process);
}
+ pthread_mutex_destroy(&lib->mutex);
+
free(lib);
}