[quartz] Remove extra reference on layer's cairo_surface.

This commit is contained in:
John Ralls 2022-06-30 15:27:03 -07:00
parent f48bed22db
commit 09dd73feeb
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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
{