Content-Length: 247430 | pFad | https://github.com/zig-gamedev/zig-gamedev/issues/566

93 minimal_zgui_win32_d3d12 segfault on exit · Issue #566 · zig-gamedev/zig-gamedev · GitHub
Skip to content

minimal_zgui_win32_d3d12 segfault on exit #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hazeycode opened this issue Apr 20, 2024 · 2 comments
Open

minimal_zgui_win32_d3d12 segfault on exit #566

hazeycode opened this issue Apr 20, 2024 · 2 comments
Milestone

Comments

@hazeycode
Copy link
Member

hazeycode commented Apr 20, 2024

segfaults on exit for me:

Segmentation fault at address 0x7ffd108a83f8
...\zig-gamedev\samples\minimal_zgui_win32_d3d12\src\minimal_zgui_win32_d3d12.zig:39:22: 0xd61293 in main (minimal_zgui_win32_d3d12.exe.obj)
    defer gctx.deinit(allocator);

only happens when I use the close button and not esc

Originally posted by @Pyrolistical in #562 (comment)

@hazeycode hazeycode added the bug Something isn't working label Apr 20, 2024
@Pyrolistical
Copy link
Contributor

might be related, but pressing the button fails to print "Button pressed" in console

@hazeycode hazeycode added this to the 0.7.0 milestone Jun 15, 2024
@hazeycode hazeycode added the demo label Nov 2, 2024
@clembu
Copy link

clembu commented Feb 23, 2025

The segfault doesn't happen if you handle WM_CLOSE messages to PostQuitMessage().

The demo should handle that message.
The DefWindowProcA(...) in the windows APIs will destroy the window on a WM_CLOSE, which I guess means the graphical context is freed by the time the WM_QUIT message sent from the handling of WM_DESTROY reaches the main event loop.

See also:
https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-close
https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-destroy

@hazeycode hazeycode removed bug Something isn't working demo labels May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/zig-gamedev/zig-gamedev/issues/566

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy