diff --git a/all-is-cubes-desktop/src/session.rs b/all-is-cubes-desktop/src/session.rs index 656db3e60..473c8a9fb 100644 --- a/all-is-cubes-desktop/src/session.rs +++ b/all-is-cubes-desktop/src/session.rs @@ -21,9 +21,6 @@ use crate::Session; /// Wraps a basic [`Session`] to add functionality that is common within /// all-is-cubes-desktop's scope of supported usage (such as loading a universe /// from disk). -/// -/// This type guarantees that the `renderer` will be dropped before the `window`; -/// `unsafe` graphics code may rely on this. #[derive(Debug)] pub struct DesktopSession { #[allow(missing_docs)] @@ -233,47 +230,3 @@ pub enum ClockSource { /// by the specified amount. Fixed(Duration), } - -#[cfg(test)] -mod tests { - use super::*; - - #[tokio::test] - async fn drop_order() { - use std::sync::mpsc; - - struct DropLogger { - sender: mpsc::Sender<&'static str>, - message: &'static str, - } - impl Drop for DropLogger { - fn drop(&mut self) { - self.sender.send(self.message).unwrap(); - } - } - impl crate::glue::Window for DropLogger { - fn set_title(&self, _: String) {} - } - - let (sender, receiver) = mpsc::channel(); - drop(DesktopSession::new( - crate::Executor::new(tokio::runtime::Handle::current()), - DropLogger { - sender: sender.clone(), - message: "renderer", - }, - DropLogger { - sender, - message: "window", - }, - Session::builder().build().await, - ListenableCell::new(Viewport::ARBITRARY), - false, - )); - - assert_eq!( - receiver.into_iter().collect::>(), - vec!["renderer", "window"] - ); - } -}