mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
libs: use g_clear_pointer() when possible
https://bugzilla.gnome.org/show_bug.cgi?id=797131
This commit is contained in:
parent
148d75c8af
commit
7b077cdcb9
5 changed files with 14 additions and 59 deletions
|
@ -846,11 +846,8 @@ gst_vaapi_display_destroy (GstVaapiDisplay * display)
|
|||
klass->close_display (display);
|
||||
}
|
||||
|
||||
g_free (priv->display_name);
|
||||
priv->display_name = NULL;
|
||||
|
||||
g_free (priv->vendor_string);
|
||||
priv->vendor_string = NULL;
|
||||
g_clear_pointer (&priv->display_name, g_free);
|
||||
g_clear_pointer (&priv->vendor_string, g_free);
|
||||
|
||||
gst_vaapi_display_replace (&priv->parent, NULL);
|
||||
}
|
||||
|
|
|
@ -304,15 +304,8 @@ gst_vaapi_display_drm_close_display (GstVaapiDisplay * display)
|
|||
priv->drm_device = -1;
|
||||
}
|
||||
|
||||
if (priv->device_path) {
|
||||
g_free (priv->device_path);
|
||||
priv->device_path = NULL;
|
||||
}
|
||||
|
||||
if (priv->device_path_default) {
|
||||
g_free (priv->device_path_default);
|
||||
priv->device_path_default = NULL;
|
||||
}
|
||||
g_clear_pointer (&priv->device_path, g_free);
|
||||
g_clear_pointer (&priv->device_path_default, g_free);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -194,25 +194,10 @@ gst_vaapi_display_wayland_close_display (GstVaapiDisplay * display)
|
|||
GstVaapiDisplayWaylandPrivate *const priv =
|
||||
GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE (display);
|
||||
|
||||
if (priv->output) {
|
||||
wl_output_destroy (priv->output);
|
||||
priv->output = NULL;
|
||||
}
|
||||
|
||||
if (priv->shell) {
|
||||
wl_shell_destroy (priv->shell);
|
||||
priv->shell = NULL;
|
||||
}
|
||||
|
||||
if (priv->compositor) {
|
||||
wl_compositor_destroy (priv->compositor);
|
||||
priv->compositor = NULL;
|
||||
}
|
||||
|
||||
if (priv->registry) {
|
||||
wl_registry_destroy (priv->registry);
|
||||
priv->registry = NULL;
|
||||
}
|
||||
g_clear_pointer (&priv->output, wl_output_destroy);
|
||||
g_clear_pointer (&priv->shell, wl_shell_destroy);
|
||||
g_clear_pointer (&priv->compositor, wl_compositor_destroy);
|
||||
g_clear_pointer (&priv->registry, wl_registry_destroy);
|
||||
|
||||
if (priv->wl_display) {
|
||||
if (!priv->use_foreign_display)
|
||||
|
@ -220,10 +205,7 @@ gst_vaapi_display_wayland_close_display (GstVaapiDisplay * display)
|
|||
priv->wl_display = NULL;
|
||||
}
|
||||
|
||||
if (priv->display_name) {
|
||||
g_free (priv->display_name);
|
||||
priv->display_name = NULL;
|
||||
}
|
||||
g_clear_pointer (&priv->display_name, g_free);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -180,10 +180,7 @@ gst_vaapi_display_x11_close_display (GstVaapiDisplay * display)
|
|||
priv->x11_display = NULL;
|
||||
}
|
||||
|
||||
if (priv->display_name) {
|
||||
g_free (priv->display_name);
|
||||
priv->display_name = NULL;
|
||||
}
|
||||
g_clear_pointer (&priv->display_name, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -95,10 +95,7 @@ frame_state_free (FrameState * frame)
|
|||
}
|
||||
gst_vaapi_video_pool_replace (&frame->surface_pool, NULL);
|
||||
|
||||
if (frame->callback) {
|
||||
wl_callback_destroy (frame->callback);
|
||||
frame->callback = NULL;
|
||||
}
|
||||
g_clear_pointer (&frame->callback, wl_callback_destroy);
|
||||
g_slice_free (FrameState, frame);
|
||||
}
|
||||
|
||||
|
@ -337,20 +334,9 @@ gst_vaapi_window_wayland_destroy (GstVaapiWindow * window)
|
|||
if (priv->event_queue)
|
||||
wl_display_roundtrip_queue (wl_display, priv->event_queue);
|
||||
|
||||
if (priv->shell_surface) {
|
||||
wl_shell_surface_destroy (priv->shell_surface);
|
||||
priv->shell_surface = NULL;
|
||||
}
|
||||
|
||||
if (priv->surface) {
|
||||
wl_surface_destroy (priv->surface);
|
||||
priv->surface = NULL;
|
||||
}
|
||||
|
||||
if (priv->event_queue) {
|
||||
wl_event_queue_destroy (priv->event_queue);
|
||||
priv->event_queue = NULL;
|
||||
}
|
||||
g_clear_pointer (&priv->shell_surface, wl_shell_surface_destroy);
|
||||
g_clear_pointer (&priv->surface, wl_surface_destroy);
|
||||
g_clear_pointer (&priv->event_queue, wl_event_queue_destroy);
|
||||
|
||||
gst_poll_free (priv->poll);
|
||||
|
||||
|
|
Loading…
Reference in a new issue