static void gst_wl_display_finalize (GObject * gobject) { GstWlDisplay *self = GST_WL_DISPLAY (gobject); gst_poll_set_flushing (self->wl_fd_poll, TRUE); if (self->thread) g_thread_join (self->thread); /* to avoid buffers being unregistered from another thread * at the same time, take their ownership */ g_mutex_lock (&self->buffers_mutex); self->shutting_down = TRUE; g_hash_table_foreach (self->buffers, (GHFunc) g_object_ref, NULL); g_mutex_unlock (&self->buffers_mutex); g_hash_table_foreach (self->buffers, (GHFunc) gst_wl_buffer_force_release_and_unref, NULL); g_hash_table_remove_all (self->buffers); g_array_unref (self->shm_formats); g_array_unref (self->dmabuf_formats); gst_poll_free (self->wl_fd_poll); g_hash_table_unref (self->buffers); g_mutex_clear (&self->buffers_mutex); if (self->viewporter) wp_viewporter_destroy (self->viewporter); if (self->shm) wl_shm_destroy (self->shm); if (self->dmabuf) zwp_linux_dmabuf_v1_destroy (self->dmabuf); if (self->shell) wl_shell_destroy (self->shell); if (self->compositor) wl_compositor_destroy (self->compositor); if (self->subcompositor) wl_subcompositor_destroy (self->subcompositor); if (self->registry) wl_registry_destroy (self->registry); if (self->queue) wl_event_queue_destroy (self->queue); if (self->own_display) { wl_display_flush (self->display); wl_display_disconnect (self->display); } G_OBJECT_CLASS (gst_wl_display_parent_class)->finalize (gobject); }
static void gst_wl_display_finalize (GObject * gobject) { GstWlDisplay *self = GST_WL_DISPLAY (gobject); gst_poll_set_flushing (self->wl_fd_poll, TRUE); if (self->thread) g_thread_join (self->thread); g_array_unref (self->formats); gst_poll_free (self->wl_fd_poll); if (self->shm) wl_shm_destroy (self->shm); if (self->shell) wl_shell_destroy (self->shell); if (self->compositor) wl_compositor_destroy (self->compositor); if (self->subcompositor) wl_subcompositor_destroy (self->subcompositor); if (self->registry) wl_registry_destroy (self->registry); if (self->queue) wl_event_queue_destroy (self->queue); if (self->own_display) { wl_display_flush (self->display); wl_display_disconnect (self->display); } G_OBJECT_CLASS (gst_wl_display_parent_class)->finalize (gobject); }