mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-23 06:24:48 +00:00
Ignore race conditions when closing dialogs
This commit is contained in:
@@ -27,7 +27,15 @@ public class DialogManager : IDisposable
|
|||||||
{
|
{
|
||||||
void OnScreenClosed(object? closeSender, EventArgs args)
|
void OnScreenClosed(object? closeSender, EventArgs args)
|
||||||
{
|
{
|
||||||
openArgs.Session.Close();
|
try
|
||||||
|
{
|
||||||
|
openArgs.Session.Close();
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException)
|
||||||
|
{
|
||||||
|
// Race condition: dialog is already being closed
|
||||||
|
}
|
||||||
|
|
||||||
dialogScreen.Closed -= OnScreenClosed;
|
dialogScreen.Closed -= OnScreenClosed;
|
||||||
}
|
}
|
||||||
dialogScreen.Closed += OnScreenClosed;
|
dialogScreen.Closed += OnScreenClosed;
|
||||||
|
|||||||
Reference in New Issue
Block a user