client: don't hold a strong stream reference while creating decoders

shard_accumulator only keeps a weak_ptr to the stream, but setup() passed
it a temporary from shared_from_this(). setup() runs on the network
thread, so if the main thread drops its reference meanwhile (e.g. while
shutting down after XR_ERROR_INSTANCE_LOST), that temporary is the last
one and ~stream runs on the network thread. It then joins
network_thread from itself: std::system_error (EDEADLK) and
std::terminate.

Pass weak_from_this() instead so no strong reference is created.
This commit is contained in:
Philip Poloczek
2026-10-07 13:24:15 +02:00
committed by xytovl
parent ab63b0503e
commit 640e1a5405
+1 -1
View File
@@ -1298,7 +1298,7 @@ void scenes::stream::setup(const to_headset::video_stream_description & descript
for (const auto & [stream_index, item]: utils::enumerate(decoders))
{
item = accumulator_images{
.decoder = std::make_unique<shard_accumulator>(device, physical_device, instance, queue_family_index, description, shared_from_this(), stream_index),
.decoder = std::make_unique<shard_accumulator>(device, physical_device, instance, queue_family_index, description, weak_from_this(), stream_index),
};
}