Skip to content

Commit f6d11dc

Browse files
committed
desktop: Remove Session drop order guarantee.
It is no longer used.
1 parent cd2c902 commit f6d11dc

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

all-is-cubes-desktop/src/session.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ use crate::Session;
2121
/// Wraps a basic [`Session`] to add functionality that is common within
2222
/// all-is-cubes-desktop's scope of supported usage (such as loading a universe
2323
/// from disk).
24-
///
25-
/// This type guarantees that the `renderer` will be dropped before the `window`;
26-
/// `unsafe` graphics code may rely on this.
2724
#[derive(Debug)]
2825
pub struct DesktopSession<Ren, Win> {
2926
#[allow(missing_docs)]
@@ -233,47 +230,3 @@ pub enum ClockSource {
233230
/// by the specified amount.
234231
Fixed(Duration),
235232
}
236-
237-
#[cfg(test)]
238-
mod tests {
239-
use super::*;
240-
241-
#[tokio::test]
242-
async fn drop_order() {
243-
use std::sync::mpsc;
244-
245-
struct DropLogger {
246-
sender: mpsc::Sender<&'static str>,
247-
message: &'static str,
248-
}
249-
impl Drop for DropLogger {
250-
fn drop(&mut self) {
251-
self.sender.send(self.message).unwrap();
252-
}
253-
}
254-
impl crate::glue::Window for DropLogger {
255-
fn set_title(&self, _: String) {}
256-
}
257-
258-
let (sender, receiver) = mpsc::channel();
259-
drop(DesktopSession::new(
260-
crate::Executor::new(tokio::runtime::Handle::current()),
261-
DropLogger {
262-
sender: sender.clone(),
263-
message: "renderer",
264-
},
265-
DropLogger {
266-
sender,
267-
message: "window",
268-
},
269-
Session::builder().build().await,
270-
ListenableCell::new(Viewport::ARBITRARY),
271-
false,
272-
));
273-
274-
assert_eq!(
275-
receiver.into_iter().collect::<Vec<_>>(),
276-
vec!["renderer", "window"]
277-
);
278-
}
279-
}

0 commit comments

Comments
 (0)