@@ -21,9 +21,6 @@ use crate::Session;
21
21
/// Wraps a basic [`Session`] to add functionality that is common within
22
22
/// all-is-cubes-desktop's scope of supported usage (such as loading a universe
23
23
/// from disk).
24
- ///
25
- /// This type guarantees that the `renderer` will be dropped before the `window`;
26
- /// `unsafe` graphics code may rely on this.
27
24
#[ derive( Debug ) ]
28
25
pub struct DesktopSession < Ren , Win > {
29
26
#[ allow( missing_docs) ]
@@ -233,47 +230,3 @@ pub enum ClockSource {
233
230
/// by the specified amount.
234
231
Fixed ( Duration ) ,
235
232
}
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