[gtk/gtk-3-24] [quartz] Remove extra reference on layer's cairo_surface.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24] [quartz] Remove extra reference on layer's cairo_surface.
- Date: Thu, 30 Jun 2022 22:27:38 +0000 (UTC)
commit 09dd73feeb8acce7d562c1f3d263db991caeacac
Author: John Ralls <jralls ceridwen us>
Date: Thu Jun 30 15:27:03 2022 -0700
[quartz] Remove extra reference on layer's cairo_surface.
gdk/quartz/GdkQuartzView.c | 2 +-
gdk/quartz/gdkwindow-quartz.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index d35a0c73f1..af28e37bea 100644
--- a/gdk/quartz/GdkQuartzView.c
+++ b/gdk/quartz/GdkQuartzView.c
@@ -453,7 +453,7 @@ copy_rectangle_argb32 (cairo_surface_t *dest, cairo_surface_t *source,
cairo_surface_destroy (cvpb_surface);
cairo_region_destroy (bounds_region);
- _gdk_quartz_unref_cairo_surface (gdk_window);
+ _gdk_quartz_unref_cairo_surface (gdk_window); // reffed in gdk_window_impl_quartz_begin_paint
CVPixelBufferUnlockBaseAddress (pixels, 0);
--impl->in_paint_rect_count;
self.layer.contents = NULL;
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 9c31f41fd1..9f8534e5c1 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -352,7 +352,7 @@ gdk_window_impl_quartz_init (GdkWindowImplQuartz *impl)
static gboolean
gdk_window_impl_quartz_begin_paint (GdkWindow *window)
{
- gdk_quartz_ref_cairo_surface (window);
+ gdk_quartz_ref_cairo_surface (window); //unreffed in GdkQuartzView::updateLayer
return FALSE;
}
@@ -1386,6 +1386,7 @@ move_resize_window_internal (GdkWindow *window,
frame_rect = [impl->toplevel frameRectForContentRect:content_rect];
[impl->toplevel setFrame:frame_rect display:YES];
impl->cairo_surface = gdk_quartz_ref_cairo_surface (window);
+ cairo_surface_destroy (impl->cairo_surface); // Remove the extra reference
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]