From f9d1a37621c1fe3ae8d252d1473e6eb6007cc744 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 4 Jun 2013 17:42:22 +0200 Subject: [PATCH] Fixed unguarded calls to monitor callback. --- README.md | 1 + src/monitor.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 29a2e817..7f078eec 100644 --- a/README.md +++ b/README.md @@ -461,6 +461,7 @@ skills. * Matt Arsenault * Keith Bauer * John Bartholomew + * Niklas Bergström * blanco * Lambert Clara * Noel Cower diff --git a/src/monitor.c b/src/monitor.c index bacc6a70..337e57e2 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -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);