From 2ed4e8c90695acbd3d5e83a1357c30ab10e8bad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 15 Apr 2021 16:32:53 +0200 Subject: [PATCH] kms-impl/simple: Discard pending flips when finalizing Removing the reference isn't enough, the callbacks needs to be invoked so the buffer state machinery gets notified about the page flips being discarded. Part-of: --- src/backends/native/meta-kms-impl-device-simple.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backends/native/meta-kms-impl-device-simple.c b/src/backends/native/meta-kms-impl-device-simple.c index 21ced99e8..480dcb750 100644 --- a/src/backends/native/meta-kms-impl-device-simple.c +++ b/src/backends/native/meta-kms-impl-device-simple.c @@ -1477,10 +1477,12 @@ meta_kms_impl_device_simple_finalize (GObject *object) g_list_free_full (impl_device_simple->pending_page_flip_retries, (GDestroyNotify) retry_page_flip_data_free); - g_list_free_full (impl_device_simple->postponed_page_flip_datas, - (GDestroyNotify) meta_kms_page_flip_data_discard_in_impl); - g_list_free_full (impl_device_simple->postponed_mode_set_fallback_datas, - (GDestroyNotify) meta_kms_page_flip_data_discard_in_impl); + dispatch_page_flip_datas (&impl_device_simple->postponed_page_flip_datas, + (GFunc) meta_kms_page_flip_data_discard_in_impl, + NULL); + dispatch_page_flip_datas (&impl_device_simple->postponed_mode_set_fallback_datas, + (GFunc) meta_kms_page_flip_data_discard_in_impl, + NULL); g_clear_pointer (&impl_device_simple->mode_set_fallback_feedback_source, g_source_destroy);