glfw: Leftover errdefer in glfw.init #826
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#826
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
github.com/hexops/mach@5cf18801a1/libs/glfw/src/main.zig (L92-L98)The
errdeferhere will not trigger asglfw.init()returns a bool, not an error union. This means that the assert will be incorrectly triggered ifglfw.init()is invoked after a previous invocation ofglfw.init()returned false. Some other mechanism is required to unset the debug value.Also,
glfw.terminate()shouldn't need to assert that GLFW is initialized, asglfwTerminate()has well defined behavior of doing nothing whenglfwInit()has not returned successfully. Of course, the debug value should still be unset onglfw.terminate().https://github.com/hexops/mach/issues/1166#issuecomment-2212962722