Fixed unguarded calls to monitor callback.

This commit is contained in:
Camilla Berglund 2013-06-04 17:42:22 +02:00
parent 3498163da1
commit f9d1a37621
2 changed files with 5 additions and 2 deletions

View File

@ -461,6 +461,7 @@ skills.
* Matt Arsenault
* Keith Bauer
* John Bartholomew
* Niklas Bergström
* blanco
* Lambert Clara
* Noel Cower

View File

@ -140,7 +140,8 @@ void _glfwInputMonitorChange(void)
window->monitor = NULL;
}
_glfw.monitorCallback((GLFWmonitor*) monitors[i], GLFW_DISCONNECTED);
if (_glfw.monitorCallback)
_glfw.monitorCallback((GLFWmonitor*) monitors[i], GLFW_DISCONNECTED);
}
// Find and report newly connected monitors (not in the old list)
@ -161,7 +162,8 @@ void _glfwInputMonitorChange(void)
if (j < monitorCount)
continue;
_glfw.monitorCallback((GLFWmonitor*) _glfw.monitors[i], GLFW_CONNECTED);
if (_glfw.monitorCallback)
_glfw.monitorCallback((GLFWmonitor*) _glfw.monitors[i], GLFW_CONNECTED);
}
_glfwDestroyMonitors(monitors, monitorCount);