-
-
Notifications
You must be signed in to change notification settings - Fork 199
Closed
Labels
contributor-friendlyGood issue for contributors to take onGood issue for contributors to take onglfw
Milestone
Description
Lines 92 to 98 in 5cf1880
| pub inline fn init(hints: InitHints) bool { | |
| internal_debug.toggleInitialized(); | |
| internal_debug.assertInitialized(); | |
| errdefer { | |
| internal_debug.assertInitialized(); | |
| internal_debug.toggleInitialized(); | |
| } |
The errdefer here will not trigger as glfw.init() returns a bool, not an error union. This means that the assert will be incorrectly triggered if glfw.init() is invoked after a previous invocation of glfw.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, as glfwTerminate() has well defined behavior of doing nothing when glfwInit() has not returned successfully. Of course, the debug value should still be unset on glfw.terminate().
Metadata
Metadata
Assignees
Labels
contributor-friendlyGood issue for contributors to take onGood issue for contributors to take onglfw