From 853a9c7a8c0623d02d509f38f0f8f3507bac28c9 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 2 Dec 2020 11:35:02 -0800 Subject: [PATCH] macos: disconnect frame clock when destroying surface --- gdk/macos/gdkmacossurface.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c index 2360e1c476..5d6f2e1aaa 100644 --- a/gdk/macos/gdkmacossurface.c +++ b/gdk/macos/gdkmacossurface.c @@ -361,6 +361,17 @@ gdk_macos_surface_destroy (GdkSurface *surface, GdkMacosSurface *self = (GdkMacosSurface *)surface; GdkMacosWindow *window = g_steal_pointer (&self->window); + GdkFrameClock *frame_clock; + + if ((frame_clock = gdk_surface_get_frame_clock (GDK_SURFACE (self)))) + { + g_signal_handlers_disconnect_by_func (frame_clock, + G_CALLBACK (gdk_macos_surface_before_paint), + self); + g_signal_handlers_disconnect_by_func (frame_clock, + G_CALLBACK (gdk_macos_surface_before_paint), + self); + } g_clear_pointer (&self->title, g_free);