diff --git a/src/Windows/Avalonia.Win32/FramebufferManager.cs b/src/Windows/Avalonia.Win32/FramebufferManager.cs index f0a6430918..bdc6fb29fd 100644 --- a/src/Windows/Avalonia.Win32/FramebufferManager.cs +++ b/src/Windows/Avalonia.Win32/FramebufferManager.cs @@ -25,7 +25,7 @@ namespace Avalonia.Win32 UnmanagedMethods.GetClientRect(_hwnd, out rc); var width = rc.right - rc.left; var height = rc.bottom - rc.top; - if (_fb == null || _fb.Width != width || _fb.Height != height) + if ((_fb == null || _fb.Width != width || _fb.Height != height) && width > 0 && height > 0) { _fb?.Deallocate(); _fb = null;