servo / pathfinder

A fast, practical GPU rasterizer for fonts and vector graphics
Apache License 2.0
3.54k stars 198 forks source link

Demo panics on window close due to context not being destroyed #489

Open simbleau opened 2 years ago

simbleau commented 2 years ago

Dually noticed, I noticed and included a warning where std::mem wasn't being used. Perhaps someone previously meant to drop the context somehow and this was removed erroneously in a later commit.

warning: unused import: `std::mem`
  --> demo/native/src/main.rs:29:5
   |
29 | use std::mem;
   |     ^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
     Running `/home/spencer/temp2/pathfinder/target/debug/demo`
The application panicked (crashed).
Message:  Contexts must be destroyed explicitly with `destroy_context`!
Location: /home/spencer/.cargo/git/checkouts/surfman-d15b9f3e86c2e263/f3df871/surfman/src/platform/generic/egl/context.rs:67

Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                          (6 post panic frames hidden)                          
 6: <surfman::platform::generic::egl::context::EGLBackedContext as core::ops::drop::Drop>::drop::haf8881ec64f40d0d
    at /home/spencer/.cargo/git/checkouts/surfman-d15b9f3e86c2e263/f3df871/surfman/src/platform/generic/egl/context.rs:67
 7: core::ptr::drop_in_place::h6eb68001a3d08473
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
 8: core::ptr::drop_in_place::h61014e53c0a8f1f0
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
 9: core::ptr::drop_in_place::h29abdcc4f568a051
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
10: core::ptr::drop_in_place::h7ad202d87997c881
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
11: core::ptr::drop_in_place::h36d0fab1009939a1
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
12: core::ptr::drop_in_place::h1ca77ec8b801b1ba
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:184
13: demo::main::h58ec6edcf139b09a
    at /home/spencer/temp2/pathfinder/demo/native/src/main.rs:102
14: core::ops::function::FnOnce::call_once::h67dcb2985cae8b0f
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
15: std::sys_common::backtrace::__rust_begin_short_backtrace::hab23bac9cd9775d0
    at /home/spencer/.rustup/toolchains/1.47.0-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:137
                        (10 runtime init frames hidden)