Browse Source

Merge pull request #1784 from AvaloniaUI/fixes/correct-handling-of-close-cancellation

fix bug that was preventing user from cancelling window close.
pull/1786/head
danwalmsley 8 years ago
committed by GitHub
parent
commit
a9f11c159f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/Avalonia.Controls/Window.cs

10
src/Avalonia.Controls/Window.cs

@ -302,17 +302,23 @@ namespace Avalonia.Controls
internal void Close(bool ignoreCancel)
{
bool close = true;
try
{
if (!ignoreCancel && HandleClosing())
{
close = false;
return;
}
}
finally
{
PlatformImpl?.Dispose();
HandleClosed();
if (close)
{
PlatformImpl?.Dispose();
HandleClosed();
}
}
}

Loading…
Cancel
Save