diff --git a/rs/moq-ffi/src/origin.rs b/rs/moq-ffi/src/origin.rs index fbaa891ab2c..8ffe5fc59c8 100644 --- a/rs/moq-ffi/src/origin.rs +++ b/rs/moq-ffi/src/origin.rs @@ -741,7 +741,10 @@ mod supervision_tests { inner, driver: completion.clone(), }); - let broadcast = origin.route("retained".into(), hidden()).unwrap().broadcast().unwrap(); + // The route owns the broadcast, and it is the only handle that keeps the origin + // running once the producer is gone. + let route = origin.route("retained".into(), hidden()).unwrap(); + let broadcast = route.broadcast().unwrap(); // One importer shares a timebase and one doesn't, so both reservation paths carry the driver. let timebase = MoqMediaTimebase::new(broadcast.clone()).unwrap(); let container = MoqMediaContainerProducer::new( @@ -770,6 +773,8 @@ mod supervision_tests { .unwrap_or_else(|_| unreachable!("test keeps its panic trigger open")) = true; assert!(matches!(completion.finished().await, Err(MoqError::Task { .. }))); drop(completion); + // The origin's last owner is gone too, so only the importers still hold the failure. + drop(route); assert!(matches!(container.cut(), Err(MoqError::Task { .. }))); assert!(matches!(independent.write(Vec::new()), Err(MoqError::Task { .. }))); assert!(matches!(container.finish(), Err(MoqError::Task { .. }))); diff --git a/rs/moq-net/src/model/origin.rs b/rs/moq-net/src/model/origin.rs index e3ce501a606..00ef399a985 100644 --- a/rs/moq-net/src/model/origin.rs +++ b/rs/moq-net/src/model/origin.rs @@ -2945,8 +2945,8 @@ struct Serving { /// /// Clones share one route. Dropping the last clone retracts it, and so does closing /// its broadcast. The broadcast lives on for the subscriptions already on it for as -/// long as another of its producer handles does. It keeps the origin's [`Driver`] -/// running, so a publisher can drop every [`Producer`] and keep serving. +/// long as another of its producer handles does. The route keeps the origin's +/// [`Driver`] running, so a publisher can drop every [`Producer`] and keep serving. #[derive(Clone)] #[must_use = "dropping the last clone of a route retracts it"] pub struct Route {