aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-11-21 20:30:21 +0100
committerSverker Eriksson <[email protected]>2017-11-21 20:30:21 +0100
commit43c5b9621e4c7054378e9ff96907cca4fd92ecc7 (patch)
tree87d03d392c8a77a693270cc8d17965a8b18c2817 /erts/emulator
parent38d247019123d083ed0612ab1e35717eb36d0a13 (diff)
parent567cdef0b7b0192f0bb9b7a552ce6868795efae0 (diff)
downloadotp-43c5b9621e4c7054378e9ff96907cca4fd92ecc7.tar.gz
otp-43c5b9621e4c7054378e9ff96907cca4fd92ecc7.tar.bz2
otp-43c5b9621e4c7054378e9ff96907cca4fd92ecc7.zip
Merge branch 'sverker/nif-debug-bin-check' into maint
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_nif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 3ade17b10d..f67b67325d 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -550,6 +550,9 @@ void enif_clear_env(ErlNifEnv* env)
ASSERT(p == menv->env.proc);
ASSERT(p->common.id == ERTS_INVALID_PID);
ASSERT(MBUF(p) == menv->env.heap_frag);
+
+ free_tmp_objs(env);
+
if (MBUF(p) != NULL) {
erts_cleanup_offheap(&MSO(p));
clear_offheap(&MSO(p));
@@ -561,7 +564,6 @@ void enif_clear_env(ErlNifEnv* env)
menv->env.hp = menv->env.hp_end = HEAP_TOP(p);
ASSERT(!is_offheap(&MSO(p)));
- free_tmp_objs(env);
}
#ifdef ERTS_SMP