mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-05 07:40:01 +00:00
vulkanswapper: disconnect window signals before any internal resources
Otherwise, it's racy whether the necessary resources are available in the signal callbacks on destruction.
This commit is contained in:
parent
ffa82e07a7
commit
5ab92e05d8
1 changed files with 9 additions and 9 deletions
|
@ -480,6 +480,15 @@ gst_vulkan_swapper_finalize (GObject * object)
|
|||
GstVulkanSwapper *swapper = GST_VULKAN_SWAPPER (object);
|
||||
int i;
|
||||
|
||||
g_signal_handler_disconnect (swapper->window, swapper->priv->draw_id);
|
||||
swapper->priv->draw_id = 0;
|
||||
|
||||
g_signal_handler_disconnect (swapper->window, swapper->priv->close_id);
|
||||
swapper->priv->close_id = 0;
|
||||
|
||||
g_signal_handler_disconnect (swapper->window, swapper->priv->resize_id);
|
||||
swapper->priv->resize_id = 0;
|
||||
|
||||
if (!gst_vulkan_trash_list_wait (swapper->priv->trash_list, -1))
|
||||
GST_WARNING_OBJECT (swapper, "Failed to wait for all fences to complete "
|
||||
"before shutting down");
|
||||
|
@ -523,15 +532,6 @@ gst_vulkan_swapper_finalize (GObject * object)
|
|||
gst_object_unref (swapper->device);
|
||||
swapper->device = NULL;
|
||||
|
||||
g_signal_handler_disconnect (swapper->window, swapper->priv->draw_id);
|
||||
swapper->priv->draw_id = 0;
|
||||
|
||||
g_signal_handler_disconnect (swapper->window, swapper->priv->close_id);
|
||||
swapper->priv->close_id = 0;
|
||||
|
||||
g_signal_handler_disconnect (swapper->window, swapper->priv->resize_id);
|
||||
swapper->priv->resize_id = 0;
|
||||
|
||||
if (swapper->window)
|
||||
gst_object_unref (swapper->window);
|
||||
swapper->window = NULL;
|
||||
|
|
Loading…
Reference in a new issue