From 640e1a540540edaef95b2270cfed3846c85887d4 Mon Sep 17 00:00:00 2001 From: Philip Poloczek Date: Wed, 7 Oct 2026 09:41:00 +0200 Subject: [PATCH] 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. --- client/scenes/stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index 1fe81885..f36dc535 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -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(device, physical_device, instance, queue_family_index, description, shared_from_this(), stream_index), + .decoder = std::make_unique(device, physical_device, instance, queue_family_index, description, weak_from_this(), stream_index), }; }