From fae68315809168b4723da603b93fba3dafe11810 Mon Sep 17 00:00:00 2001 From: Gregory Burd Date: Sun, 21 Apr 2013 11:11:17 -0400 Subject: [PATCH] Ensure that the env is clear when signaling shutdown. --- c_src/async_nif.h | 1 + 1 file changed, 1 insertion(+) diff --git a/c_src/async_nif.h b/c_src/async_nif.h index a89262a..afbf270 100644 --- a/c_src/async_nif.h +++ b/c_src/async_nif.h @@ -296,6 +296,7 @@ async_nif_unload(ErlNifEnv *env, struct async_nif_state *async_nif) /* Worker threads are stopped, now toss anything left in the queue. */ struct async_nif_req_entry *req = NULL; fifo_q_foreach(reqs, q->reqs, req, { + enif_clear_env(req->env); enif_send(NULL, &req->pid, req->env, enif_make_tuple2(req->env, enif_make_atom(req->env, "error"), enif_make_atom(req->env, "shutdown")));