diff options
author | Rickard Green <[email protected]> | 2016-03-31 16:06:10 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2016-03-31 16:06:10 +0200 |
commit | d97dc2c64be5530b22c8e4f9e11d246285ea8a17 (patch) | |
tree | 356bc457b4c9bae21db8f209eeff5cbb1e3daa0c /erts/emulator/beam/erl_process.c | |
parent | 07b8f441ca711f9812fad9e9115bab3c3aa92f79 (diff) | |
download | otp-d97dc2c64be5530b22c8e4f9e11d246285ea8a17.tar.gz otp-d97dc2c64be5530b22c8e4f9e11d246285ea8a17.tar.bz2 otp-d97dc2c64be5530b22c8e4f9e11d246285ea8a17.zip |
Fix bad refc management of process struct
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r-- | erts/emulator/beam/erl_process.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c index b4b97d7df1..2b468a9ad9 100644 --- a/erts/emulator/beam/erl_process.c +++ b/erts/emulator/beam/erl_process.c @@ -9293,17 +9293,18 @@ Process *schedule(Process *p, int calls) | ERTS_PSFLG_PENDING_EXIT | ERTS_PSFLG_ACTIVE_SYS)) == ERTS_PSFLG_SUSPENDED)) { - if (state & ERTS_PSFLG_FREE) { + if (proxy_p) { + free_proxy_proc(proxy_p); + proxy_p = NULL; + } + else if (state & ERTS_PSFLG_FREE) { + /* free and not queued by proxy */ #ifdef ERTS_SMP erts_smp_proc_dec_refc(p); #else erts_free_proc(p); #endif } - if (proxy_p) { - free_proxy_proc(proxy_p); - proxy_p = NULL; - } goto pick_next_process; } state = new; |