Skip to content

Commit

Permalink
Fix crash or hang in some cases
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 4, 2024
1 parent a66a64a commit b580c27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/Common/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,12 +562,13 @@ size_t Core::Menu_File_Open_Files_Finish_End()
{
CS.Enter();
Canceled=true;
Handler->second.Riff->Cancel();
if (Handler->second.Riff)
Handler->second.Riff->Cancel();
CS.Leave();
while(!IsExited())
while(Handler->second.Riff && !Handler->second.Riff->Canceled_Get())
Sleep(20);
}

CriticalSectionLocker CSL(CS);

//In case of cancel
Expand All @@ -581,7 +582,6 @@ size_t Core::Menu_File_Open_Files_Finish_End()
Handler++;
Handlers.erase(Handler_ToDelete);

CriticalSectionLocker CSL(CS);
Menu_File_Open_Files_File_Pos--;
Menu_File_Open_Files_File_Total--;
}
Expand Down

0 comments on commit b580c27

Please sign in to comment.