aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-03-30 15:53:05 +0200
committerSverker Eriksson <[email protected]>2012-03-30 15:53:05 +0200
commit73e6d0f2b775e9ff8d65ccdb2dfbef2cb211e91a (patch)
tree7e6d20b9726483fc0af5a761df90bb34b15e7542 /erts/emulator/beam
parentf2ea92776a292ff07601e6bbab7663667b50efad (diff)
downloadotp-73e6d0f2b775e9ff8d65ccdb2dfbef2cb211e91a.tar.gz
otp-73e6d0f2b775e9ff8d65ccdb2dfbef2cb211e91a.tar.bz2
otp-73e6d0f2b775e9ff8d65ccdb2dfbef2cb211e91a.zip
erts: Fix memory leak caused by race on exiting process
Seen with valgrind running ets_SUITE:delete_large_tab or delete_large_named_table.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_process_lock.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_process_lock.h b/erts/emulator/beam/erl_process_lock.h
index 97e554914e..8dbdaccc68 100644
--- a/erts/emulator/beam/erl_process_lock.h
+++ b/erts/emulator/beam/erl_process_lock.h
@@ -958,8 +958,6 @@ erts_pid2proc_opt(Process *c_p,
if (flags & ERTS_P2P_FLG_TRY_LOCK)
proc = ERTS_PROC_LOCK_BUSY;
else {
- if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
- proc->lock.refc++;
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_lcnt_proc_lock_unaquire(&proc->lock, lcnt_locks);
#endif
@@ -969,6 +967,8 @@ erts_pid2proc_opt(Process *c_p,
pid_need_locks,
pix_lock,
flags);
+ if (proc && (flags & ERTS_P2P_FLG_SMP_INC_REFC))
+ proc->lock.refc++;
}
}
}