MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / glfwDestroyWindow

Function glfwDestroyWindow

extern/glfw/src/window.c:419–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419GLFWAPI void glfwDestroyWindow(GLFWwindow* handle)
420{
421 _GLFWwindow* window = (_GLFWwindow*) handle;
422
423 _GLFW_REQUIRE_INIT();
424
425 // Allow closing of NULL (to match the behavior of free)
426 if (window == NULL)
427 return;
428
429 // Clear all callbacks to avoid exposing a half torn-down window object
430 memset(&window->callbacks, 0, sizeof(window->callbacks));
431
432 // The window's context must not be current on another thread when the
433 // window is destroyed
434 if (window == _glfwPlatformGetTls(&_glfw.contextSlot))
435 glfwMakeContextCurrent(NULL);
436
437 _glfwPlatformDestroyWindow(window);
438
439 // Unlink window from global linked list
440 {
441 _GLFWwindow** prev = &_glfw.windowListHead;
442
443 while (*prev != window)
444 prev = &((*prev)->next);
445
446 *prev = window->next;
447 }
448
449 free(window);
450}
451
452GLFWAPI int glfwWindowShouldClose(GLFWwindow* handle)
453{

Callers 4

terminateFunction · 0.85
glfwCreateWindowFunction · 0.85
mainLoopMethod · 0.85

Calls 3

glfwMakeContextCurrentFunction · 0.85
_glfwPlatformGetTlsFunction · 0.70

Tested by

no test coverage detected