PistonDevelopers/piston-examples

multi_window.rs always segfaults

Opened this issue · 2 comments

All other examples work fine. The issue is resolved when the window-spawning iterator's 0..3 is changed to 0..1, so it's either a problem with the gfx library (seems likely) or an OS issue. The gfx-rs library has been deprecated anyway: https://github.com/gfx-rs/gfx

rustc: 1.34.2 stable-x86_64-unknown-linux-gnu

Linux 4.4.0-145-generic #174-Ubuntu

https://github.com/rust-windowing/winit.git

tag v0.19.1

commit d4faf28cbe211d2b2c4b797862fb46339416f368 (HEAD -> tag-v0.19.1)
Author: Hunt Lin <hunt.lin@tes-tec.com>
Date:   Thu Nov 7 14:29:42 2019 +0800

    Determine im before close it.

diff --git a/src/platform/linux/x11/ime/inner.rs b/src/platform/linux/x11/ime/inner.rs
index 34bfbe7..72ee481 100644
--- a/src/platform/linux/x11/ime/inner.rs
+++ b/src/platform/linux/x11/ime/inner.rs
@@ -9,7 +9,9 @@ use super::input_method::PotentialInputMethods;
 use super::context::ImeContext;
 
 pub unsafe fn close_im(xconn: &Arc<XConnection>, im: ffi::XIM) -> Result<(), XError> {
-    (xconn.xlib.XCloseIM)(im);
+    if !im.is_null() {
+        (xconn.xlib.XCloseIM)(im);
+    }
     xconn.check_errors()
 }

CAN ANYBODY PLEASE FIX THIS??