From 73e6d0f2b775e9ff8d65ccdb2dfbef2cb211e91a Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 30 Mar 2012 15:53:05 +0200 Subject: erts: Fix memory leak caused by race on exiting process Seen with valgrind running ets_SUITE:delete_large_tab or delete_large_named_table. --- erts/emulator/beam/erl_process_lock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/emulator/beam') 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++; } } } -- cgit v1.2.3