Browse Source

Make sure that HandleClosed is called only once

pull/10974/head
Nikita Tsukanov 3 years ago
parent
commit
727e6ccdfd
  1. 1
      src/Avalonia.Controls/Primitives/PopupRoot.cs
  2. 2
      src/Avalonia.Controls/TopLevel.cs
  3. 1
      src/Avalonia.X11/X11Window.cs

1
src/Avalonia.Controls/Primitives/PopupRoot.cs

@ -90,7 +90,6 @@ namespace Avalonia.Controls.Primitives
public void Dispose()
{
PlatformImpl?.Dispose();
HandleClosed();
}
private void UpdatePosition()

2
src/Avalonia.Controls/TopLevel.cs

@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using Avalonia.Reactive;
using Avalonia.Controls.Metadata;
using Avalonia.Controls.Platform;
@ -531,6 +532,7 @@ namespace Avalonia.Controls
// We need to wait for the renderer to complete any in-flight operations
Renderer.Dispose();
Debug.Assert(PlatformImpl != null);
// The PlatformImpl is completely invalid at this point
PlatformImpl = null;

1
src/Avalonia.X11/X11Window.cs

@ -898,7 +898,6 @@ namespace Avalonia.X11
_platform.XI2?.OnWindowDestroyed(_handle);
var handle = _handle;
_handle = IntPtr.Zero;
Closed?.Invoke();
_mouse.Dispose();
_touch.Dispose();
if (!fromDestroyNotification)

Loading…
Cancel
Save