From 48a795c10117875f3cf58673f1d2140a197b61e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 10 Jan 2017 15:01:55 +0100 Subject: [PATCH] Merge single-use function _glfwFreeMonitors All other uses were elminiated by _glfwInputMonitor. --- src/init.c | 6 +++--- src/internal.h | 4 ---- src/monitor.c | 10 ---------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/init.c b/src/init.c index abc2f1b5..7d60d133 100644 --- a/src/init.c +++ b/src/init.c @@ -160,14 +160,14 @@ GLFWAPI void glfwTerminate(void) _GLFWmonitor* monitor = _glfw.monitors[i]; if (monitor->originalRamp.size) _glfwPlatformSetGammaRamp(monitor, &monitor->originalRamp); + _glfwFreeMonitor(monitor); } - _glfwTerminateVulkan(); - - _glfwFreeMonitors(_glfw.monitors, _glfw.monitorCount); + free(_glfw.monitors); _glfw.monitors = NULL; _glfw.monitorCount = 0; + _glfwTerminateVulkan(); _glfwPlatformTerminate(); memset(&_glfw, 0, sizeof(_glfw)); diff --git a/src/internal.h b/src/internal.h index 50f1b4c5..fb5d6966 100644 --- a/src/internal.h +++ b/src/internal.h @@ -1065,10 +1065,6 @@ _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM); */ void _glfwFreeMonitor(_GLFWmonitor* monitor); -/*! @ingroup utility - */ -void _glfwFreeMonitors(_GLFWmonitor** monitors, int count); - /*! @ingroup utility */ GLFWbool _glfwIsPrintable(int key); diff --git a/src/monitor.c b/src/monitor.c index eb19bb7c..4c747710 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -180,16 +180,6 @@ void _glfwFreeGammaArrays(GLFWgammaramp* ramp) memset(ramp, 0, sizeof(GLFWgammaramp)); } -void _glfwFreeMonitors(_GLFWmonitor** monitors, int count) -{ - int i; - - for (i = 0; i < count; i++) - _glfwFreeMonitor(monitors[i]); - - free(monitors); -} - const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) {