aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_util.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-07-12 16:02:04 +0200
committerSverker Eriksson <[email protected]>2011-07-12 16:02:04 +0200
commit089b8c357f5e7c96605c8f8cab4b3c856081dc39 (patch)
tree035992b3c4d81b7da52e6a42dfeb53b65f642942 /erts/emulator/beam/erl_db_util.c
parent2a5d951162e6d9c918132d60c5c39302399dfca4 (diff)
parentd328f453e7cd6e24856b0c80e0b8c4ed6def5461 (diff)
downloadotp-089b8c357f5e7c96605c8f8cab4b3c856081dc39.tar.gz
otp-089b8c357f5e7c96605c8f8cab4b3c856081dc39.tar.bz2
otp-089b8c357f5e7c96605c8f8cab4b3c856081dc39.zip
Merge branch 'maint-r14' into dev
Conflicts: erts/vsn.mk
Diffstat (limited to 'erts/emulator/beam/erl_db_util.c')
-rw-r--r--erts/emulator/beam/erl_db_util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c
index c3b074f782..e5be1f253a 100644
--- a/erts/emulator/beam/erl_db_util.c
+++ b/erts/emulator/beam/erl_db_util.c
@@ -1731,6 +1731,7 @@ Eterm db_prog_match(Process *c_p, Binary *bprog,
#define BEGIN_ATOMIC_TRACE(p) \
do { \
if (! atomic_trace) { \
+ erts_refc_inc(&bprog->refc, 2); \
erts_smp_proc_unlock((p), ERTS_PROC_LOCK_MAIN); \
erts_smp_block_system(0); \
atomic_trace = !0; \
@@ -1741,6 +1742,9 @@ Eterm db_prog_match(Process *c_p, Binary *bprog,
if (atomic_trace) { \
erts_smp_release_system(); \
erts_smp_proc_lock((p), ERTS_PROC_LOCK_MAIN); \
+ if (erts_refc_dectest(&bprog->refc, 0) == 0) {\
+ erts_bin_free(bprog); \
+ } \
atomic_trace = 0; \
} \
} while (0)