Browse Source
Fixing a memory leak when closing a window (#19699)
Added unsubscription from the X11Globals.WindowActivationTrackingModeChanged event in the Dispose method of the WindowActivationTrackingHelper class
pull/19709/head
dif-sam
11 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
1 deletions
-
src/Avalonia.X11/ActivityTrackingHelper.cs
|
|
@ -81,6 +81,7 @@ internal class WindowActivationTrackingHelper : IDisposable |
|
|
public void Dispose() |
|
|
public void Dispose() |
|
|
{ |
|
|
{ |
|
|
_platform.Globals.NetActiveWindowPropertyChanged -= OnNetActiveWindowChanged; |
|
|
_platform.Globals.NetActiveWindowPropertyChanged -= OnNetActiveWindowChanged; |
|
|
|
|
|
_platform.Globals.WindowActivationTrackingModeChanged -= OnWindowActivationTrackingModeChanged; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void OnNetWmStateChanged(IntPtr[] atoms) |
|
|
public void OnNetWmStateChanged(IntPtr[] atoms) |
|
|
@ -88,4 +89,4 @@ internal class WindowActivationTrackingHelper : IDisposable |
|
|
if (Mode == X11Globals.WindowActivationTrackingMode._NET_WM_STATE_FOCUSED) |
|
|
if (Mode == X11Globals.WindowActivationTrackingMode._NET_WM_STATE_FOCUSED) |
|
|
SetActive(atoms.Contains(_platform.Info.Atoms._NET_WM_STATE_FOCUSED)); |
|
|
SetActive(atoms.Contains(_platform.Info.Atoms._NET_WM_STATE_FOCUSED)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|