Fixed two multi-window bugs.

This commit is contained in:
Camilla Berglund 2010-09-10 00:30:10 +02:00
parent 326d997c1c
commit 44acfaa0b1

View File

@ -388,11 +388,11 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int mode)
return NULL; return NULL;
} }
memset(window, 0, sizeof(_GLFWwindow));
window->next = _glfwLibrary.windowListHead; window->next = _glfwLibrary.windowListHead;
_glfwLibrary.windowListHead = window; _glfwLibrary.windowListHead = window;
memset(window, 0, sizeof(_GLFWwindow));
// Set up desired framebuffer config // Set up desired framebuffer config
fbconfig.redBits = Max(_glfwLibrary.hints.redBits, 0); fbconfig.redBits = Max(_glfwLibrary.hints.redBits, 0);
fbconfig.greenBits = Max(_glfwLibrary.hints.greenBits, 0); fbconfig.greenBits = Max(_glfwLibrary.hints.greenBits, 0);
@ -697,13 +697,13 @@ GLFWAPI void glfwCloseWindow(GLFWwindow window)
_glfwPlatformCloseWindow(window); _glfwPlatformCloseWindow(window);
free(window);
prev = &_glfwLibrary.windowListHead; prev = &_glfwLibrary.windowListHead;
while (*prev != window) while (*prev != window)
prev = &((*prev)->next); prev = &((*prev)->next);
*prev = window->next; *prev = window->next;
free(window);
} }