[gtk/wip/chergert/macos-iosurface: 1/2] macos: add comment about purging IOSurface
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/macos-iosurface: 1/2] macos: add comment about purging IOSurface
- Date: Sat, 12 Feb 2022 10:48:01 +0000 (UTC)
commit 89922c70319003b8394bafc4b5cd6c4f90cd3c32
Author: Christian Hergert <christian hergert me>
Date: Sat Feb 12 02:32:20 2022 -0800
macos: add comment about purging IOSurface
gdk/macos/gdkmacosbuffer.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/gdk/macos/gdkmacosbuffer.c b/gdk/macos/gdkmacosbuffer.c
index 2982d39594..ac99302ee4 100644
--- a/gdk/macos/gdkmacosbuffer.c
+++ b/gdk/macos/gdkmacosbuffer.c
@@ -52,6 +52,12 @@ gdk_macos_buffer_dispose (GObject *object)
g_critical ("Attempt to dispose %s while lock is held",
G_OBJECT_TYPE_NAME (self));
+ /* We could potentially force the unload of our surface here with
+ * IOSurfaceSetPurgeable (self->surface, kIOSurfacePurgeableEmpty, NULL)
+ * but that would cause it to empty when the layers may still be attached
+ * to it. Better to just let it get GC'd by the system after they have
+ * moved on to a new buffer.
+ */
g_clear_pointer (&self->surface, CFRelease);
g_clear_pointer (&self->damage, cairo_region_destroy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]