Skip to content

Commit

Permalink
Fix hang on Windows when canceling file opening
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <[email protected]>
  • Loading branch information
g-maxime committed Oct 30, 2024
1 parent a2d0807 commit 425d8e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Common/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,10 @@ size_t Core::Menu_File_Open_Files_Finish_End()
Canceled=true;
if (Handler->second.Riff)
Handler->second.Riff->Cancel();

while(Handler->second.Riff && !Handler->second.Riff->Canceled_Get())
Sleep(20);
CS.Leave();
while(Handler->second.Riff && !Handler->second.Riff->Canceled_Get())
Sleep(20);
}

CriticalSectionLocker CSL(CS);
Expand Down

0 comments on commit 425d8e4

Please sign in to comment.