ntdll: Set the process detaching flag before calling FLS callbacks.

So that we will not deadlock trying to acquire fls_section.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-01-07 09:51:02 -06:00 committed by Alexandre Julliard
parent 32f5dfde0d
commit 16592ca918
1 changed files with 4 additions and 2 deletions

View File

@ -3182,12 +3182,14 @@ fail:
*/
void WINAPI LdrShutdownProcess(void)
{
BOOL detaching = process_detaching;
TRACE("()\n");
if (!process_detaching)
process_detaching = TRUE;
if (!detaching)
RtlProcessFlsData( NtCurrentTeb()->FlsSlots, 1 );
process_detaching = TRUE;
process_detach();
}