Browse Source

Don't try to invalidate an already closed window.

And make sure the window is hidden before `_window.Dispose` is called.
Fixes #729.
pull/730/head
Steven Kirk 10 years ago
parent
commit
52438d64db
  1. 4
      src/Gtk/Avalonia.Gtk/WindowImplBase.cs

4
src/Gtk/Avalonia.Gtk/WindowImplBase.cs

@ -134,7 +134,7 @@ namespace Avalonia.Gtk
public void Invalidate(Rect rect) public void Invalidate(Rect rect)
{ {
if (_window.GdkWindow != null) if (_window?.GdkWindow != null)
_window.GdkWindow.InvalidateRect( _window.GdkWindow.InvalidateRect(
new Rectangle((int) rect.X, (int) rect.Y, (int) rect.Width, (int) rect.Height), true); new Rectangle((int) rect.X, (int) rect.Y, (int) rect.Width, (int) rect.Height), true);
} }
@ -306,7 +306,9 @@ namespace Avalonia.Gtk
public void Dispose() public void Dispose()
{ {
_window.Hide();
_window.Dispose(); _window.Dispose();
_window = null;
} }
} }
} }

Loading…
Cancel
Save