misc: Fix some uninitialized mutexes

This commit is contained in:
Mateo de Mayo 2022-05-21 23:25:21 -03:00
parent 490e90b493
commit 7a0a142dba
4 changed files with 13 additions and 0 deletions

View file

@ -573,6 +573,7 @@ renderer_create(struct comp_renderer *r, struct comp_compositor *c)
r->mirror_to_debug_gui.image_extent.width = (uint32_t)(orig_width * mul);
r->mirror_to_debug_gui.image_extent.height = (uint32_t)(orig_height * mul);
u_sink_debug_init(&r->mirror_to_debug_gui.debug_sink);
vk_image_readback_to_xf_pool_create(vk, r->mirror_to_debug_gui.image_extent, &r->mirror_to_debug_gui.pool,
XRT_FORMAT_R8G8B8X8);
@ -769,6 +770,8 @@ renderer_destroy(struct comp_renderer *r)
// Left eye readback
vk_image_readback_to_xf_pool_destroy(vk, &r->mirror_to_debug_gui.pool);
u_sink_debug_destroy(&r->mirror_to_debug_gui.debug_sink);
// Command buffers
renderer_close_renderings_and_fences(r);

View file

@ -259,6 +259,8 @@ sdl2_close(struct sdl2_program *p)
p->win = NULL;
}
os_thread_helper_destroy(&p->oth);
if (p->sdl_initialized) {
//! @todo: Properly quit SDL without crashing SDL client apps
// SDL_Quit();
@ -296,6 +298,8 @@ oxr_sdl2_hack_create(void **out_hack)
return -1;
}
os_thread_helper_init(&p->oth);
*out_hack = p;
return 0;

View file

@ -11,6 +11,7 @@
#include "hg_sync.hpp"
#include "hg_model.hpp"
#include "util/u_sink.h"
#include <numeric>
namespace xrt::tracking::hand::mercury {
@ -290,10 +291,13 @@ HandTracking::HandTracking()
{
this->base.process = &HandTracking::cCallbackProcess;
this->base.destroy = &HandTracking::cCallbackDestroy;
u_sink_debug_init(&this->debug_sink);
}
HandTracking::~HandTracking()
{
u_sink_debug_destroy(&this->debug_sink);
release_onnx_wrap(&this->views[0].keypoint[0]);
release_onnx_wrap(&this->views[0].keypoint[1]);
release_onnx_wrap(&this->views[0].detection);

View file

@ -159,6 +159,7 @@ ht_async_destroy(struct xrt_frame_node *node)
{
struct ht_async_impl *hta = ht_async_impl(container_of(node, struct t_hand_tracking_async, node));
os_thread_helper_destroy(&hta->mainloop);
os_mutex_destroy(&hta->present.mutex);
t_ht_sync_destroy(&hta->provider);
@ -179,6 +180,7 @@ t_hand_tracking_async_default_create(struct xrt_frame_context *xfctx, struct t_h
hta->provider = sync;
os_mutex_init(&hta->present.mutex);
os_thread_helper_init(&hta->mainloop);
os_thread_helper_start(&hta->mainloop, ht_async_mainloop, hta);
xrt_frame_context_add(xfctx, &hta->base.node);