[gtk/wip/chergert/macos-fixes: 12/15] macos: check for destroyed surfaces in vfuncs
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/macos-fixes: 12/15] macos: check for destroyed surfaces in vfuncs
- Date: Thu, 3 Feb 2022 21:37:06 +0000 (UTC)
commit a1bd1550063af51cc68524169ee2bcc169d5bb9d
Author: Christian Hergert <chergert redhat com>
Date: Mon Jan 31 13:02:58 2022 -0800
macos: check for destroyed surfaces in vfuncs
gdk/macos/gdkmacossurface.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index a6a354cab7..19a4453212 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -190,6 +190,9 @@ gdk_macos_surface_end_frame (GdkMacosSurface *self)
g_assert (GDK_IS_MACOS_SURFACE (self));
+ if (GDK_SURFACE_DESTROYED (self))
+ return;
+
display = gdk_surface_get_display (GDK_SURFACE (self));
frame_clock = gdk_surface_get_frame_clock (GDK_SURFACE (self));
@@ -208,10 +211,11 @@ gdk_macos_surface_before_paint (GdkMacosSurface *self,
g_assert (GDK_IS_MACOS_SURFACE (self));
g_assert (GDK_IS_FRAME_CLOCK (frame_clock));
- if (surface->update_freeze_count > 0)
+ if (GDK_SURFACE_DESTROYED (self))
return;
- gdk_macos_surface_begin_frame (self);
+ if (surface->update_freeze_count == 0)
+ gdk_macos_surface_begin_frame (self);
}
static void
@@ -223,10 +227,11 @@ gdk_macos_surface_after_paint (GdkMacosSurface *self,
g_assert (GDK_IS_MACOS_SURFACE (self));
g_assert (GDK_IS_FRAME_CLOCK (frame_clock));
- if (surface->update_freeze_count > 0)
+ if (GDK_SURFACE_DESTROYED (self))
return;
- gdk_macos_surface_end_frame (self);
+ if (surface->update_freeze_count == 0)
+ gdk_macos_surface_end_frame (self);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]