Skip to content

Closing the game gracefully in headless mode results in a panic #2293

@BoySanic

Description

@BoySanic

Steps to Reproduce and Observed Behavior

thread 581016 panic: attempt to use null value
/home/boysanic/git/Cubyz/.zig-cache/o/4acb3828c29a2d123b580add4b5925f0/cimport.zig:6684:32: 0x150fbda in deinit (Cubyz)
    return glad_glDeleteBuffers.?(arg_444, arg_445);
                               ^
/home/boysanic/git/Cubyz/src/models.zig:810:17: 0x14d47ca in deinit (Cubyz)
 quadSSBO.deinit();
                ^
/home/boysanic/git/Cubyz/src/main.zig:550:21: 0x14ccdf1 in main (Cubyz)
 defer models.deinit();
                    ^
/home/boysanic/git/Cubyz/compiler/zig/lib/std/start.zig:672:22: 0x14cc7ad in main (Cubyz)
            root.main();
                     ^
???:?:?: 0x7fb43b227634 in ??? (libc.so.6)
Unwind information for `libc.so.6:0x7fb43b227634` was not available, trace may be incomplete

???:?:?: 0x7fb43b2276e8 in ??? (libc.so.6)
???:?:?: 0x1423b54 in ??? (???)
./debug_linux.sh: line 27: 581016 Aborted                    (core dumped) ./zig-out/bin/Cubyz

I suspect something isn't inited when we launch with headless but we deinit it even if we're in headless.

I did not catch this before because there wasn't a graceful exit from headless before. You'd just Ctrl+C to close it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething isn't working in the intended way

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions