piston-examples icon indicating copy to clipboard operation
piston-examples copied to clipboard

multi_window segfaults

Open grinapo opened this issue 2 years ago • 3 comments

And all I have is the advice to "manually update piston": https://github.com/rust-windowing/winit/issues/2683

Since I am at the level of "run the example with cargo" this is probably within a "some months" timeframe, so maybe you want to act on it now. :-)

grinapo avatar Feb 12 '23 15:02 grinapo

I updated glutin_window, but get the following error:

thread 'main' panicked at 'Creating EventLoop multiple times is not supported.'

bvssvni avatar Feb 25 '23 13:02 bvssvni

I found the place: https://github.com/rust-windowing/winit/blob/master/src/event_loop.rs#L80-L90

bvssvni avatar Feb 25 '23 13:02 bvssvni

Fixed link from the previous comment + excerpt:

https://github.com/rust-windowing/winit/blob/3217eaa416e7802b2dbc65bdfaa1c8a7a395cf17/src/event_loop.rs#L80-L90

/// Builds a new event loop.
///
/// ***For cross-platform compatibility, the [`EventLoop`] must be created on the main thread,
/// and only once per application.***
///
/// Attempting to create the event loop on a different thread, or multiple event loops in
/// the same application, will panic. This restriction isn't
/// strictly necessary on all platforms, but is imposed to eliminate any nasty surprises when
/// porting to platforms that require it. `EventLoopBuilderExt::any_thread` functions are exposed
/// in the relevant [`platform`] module if the target platform supports creating an event loop on
/// any thread.

Maybe we should update the README to document that multi_window might not work?

Aethelflaed avatar Jan 15 '24 02:01 Aethelflaed