aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/taskq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/taskq.c b/src/core/taskq.c
index 8d42701e..e0fc456c 100644
--- a/src/core/taskq.c
+++ b/src/core/taskq.c
@@ -149,7 +149,9 @@ nni_taskq_fini(nni_taskq *tq)
// First drain the taskq completely. This is necessary since some
// tasks that are presently running may need to schedule additional
// tasks, and we don't want those to block.
-
+ if (tq == NULL) {
+ return;
+ }
if (tq->tq_run) {
nni_mtx_lock(&tq->tq_mtx);
nni_taskq_drain_locked(tq);
@@ -274,4 +276,5 @@ void
nni_taskq_sys_fini(void)
{
nni_taskq_fini(nni_taskq_systq);
+ nni_taskq_systq = NULL;
}