wayland: leverage unified object destruction for wl_callback

This patch refactors gst_wl_display_callback_destroy() to use the
recently introduced gst_wl_display_object_destroy() helper. Previously,
the function manually handled wl_callback destruction with explicit
lock/unlock calls and direct invocation of wl_callback_destroy().
Switching to gst_wl_display_object_destroy() unifies the destruction
process across similar objects, reducing code duplication and potential
errors.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8242>
This commit is contained in:
Qian Hu (胡骞) 2025-02-21 09:35:37 +08:00 committed by GStreamer Marge Bot
parent 6d17596777
commit a99694cca8

View file

@ -590,16 +590,8 @@ void
gst_wl_display_callback_destroy (GstWlDisplay * self, gst_wl_display_callback_destroy (GstWlDisplay * self,
struct wl_callback **callback) struct wl_callback **callback)
{ {
GstWlDisplayPrivate *priv = gst_wl_display_get_instance_private (self); gst_wl_display_object_destroy (self, (gpointer *) callback,
(GDestroyNotify) wl_callback_destroy);
g_rec_mutex_lock (&priv->sync_mutex);
if (*callback) {
wl_callback_destroy (*callback);
*callback = NULL;
}
g_rec_mutex_unlock (&priv->sync_mutex);
} }
struct wl_display * struct wl_display *