aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2014-09-05 14:55:25 +0200
committerRickard Green <[email protected]>2014-09-05 14:55:25 +0200
commit18a38b9e5f5fbf4aa8fb7d349bc493c78626d3f6 (patch)
treeeed3eec4cd3123334af41c850a24f9e50895f0e8 /erts/emulator
parenteb3d3e8f726c64f12c00517be87c53dc5de934e2 (diff)
downloadotp-18a38b9e5f5fbf4aa8fb7d349bc493c78626d3f6.tar.gz
otp-18a38b9e5f5fbf4aa8fb7d349bc493c78626d3f6.tar.bz2
otp-18a38b9e5f5fbf4aa8fb7d349bc493c78626d3f6.zip
Fix leak of NIF exports
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_process.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index e96d5c4ccd..716875c326 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -11826,6 +11826,7 @@ erts_continue_exit_process(Process *p)
struct saved_calls *scb;
process_breakpoint_time_t *pbt;
erts_aint32_t state;
+ void *nif_export;
#ifdef DEBUG
int yield_allowed = 1;
@@ -11976,6 +11977,7 @@ erts_continue_exit_process(Process *p)
: NULL);
scb = ERTS_PROC_SET_SAVED_CALLS_BUF(p, ERTS_PROC_LOCKS_ALL, NULL);
pbt = ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCKS_ALL, NULL);
+ nif_export = ERTS_PROC_SET_NIF_TRAP_EXPORT(p, ERTS_PROC_LOCKS_ALL, NULL);
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
#ifdef BM_COUNTERS
@@ -12023,6 +12025,9 @@ erts_continue_exit_process(Process *p)
if (pbt)
erts_free(ERTS_ALC_T_BPD, (void *) pbt);
+ if (nif_export)
+ erts_destroy_nif_export(nif_export);
+
delete_process(p);
#ifdef ERTS_SMP