From a591cdeba61693e08b91233699bc3b637556a9e5 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 20 Feb 2013 15:44:37 +0100 Subject: [PATCH] Removed platform-specific resources from monitor. --- src/cocoa_monitor.m | 4 ---- src/internal.h | 4 ---- src/monitor.c | 2 -- src/win32_monitor.c | 7 +------ src/win32_platform.h | 3 ++- src/x11_monitor.c | 4 ---- 6 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index b2a4a488..cc8c7150 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -258,10 +258,6 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) return monitors; } -void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor) -{ -} - GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) { CFArrayRef modes; diff --git a/src/internal.h b/src/internal.h index e45a90b1..bce6c55c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -363,10 +363,6 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode); */ _GLFWmonitor** _glfwPlatformGetMonitors(int* count); -/*! @ingroup platform - */ -void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor); - /*! @copydoc glfwGetVideoModes * @ingroup platform */ diff --git a/src/monitor.c b/src/monitor.c index 0068ae9a..24508ea3 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -180,8 +180,6 @@ void _glfwDestroyMonitor(_GLFWmonitor* monitor) if (monitor == NULL) return; - _glfwPlatformDestroyMonitor(monitor); - free(monitor->modes); free(monitor->name); free(monitor); diff --git a/src/win32_monitor.c b/src/win32_monitor.c index bf59df07..164907de 100644 --- a/src/win32_monitor.c +++ b/src/win32_monitor.c @@ -181,7 +181,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) return NULL; } - monitors[found]->win32.name = _wcsdup(adapter.DeviceName); + wcscpy(monitors[found]->win32.name, adapter.DeviceName); found++; } @@ -196,11 +196,6 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) return monitors; } -void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor) -{ - free(monitor->win32.name); -} - GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) { int modeIndex = 0, count = 0; diff --git a/src/win32_platform.h b/src/win32_platform.h index 98d8d11d..0116ccb8 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -192,7 +192,8 @@ typedef struct _GLFWlibraryWin32 //------------------------------------------------------------------------ typedef struct _GLFWmonitorWin32 { - WCHAR* name; + // This size matches the static size of DISPLAY_DEVICE.DeviceName + WCHAR name[32]; } _GLFWmonitorWin32; diff --git a/src/x11_monitor.c b/src/x11_monitor.c index c9bf05c5..d53dd875 100644 --- a/src/x11_monitor.c +++ b/src/x11_monitor.c @@ -239,10 +239,6 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* found) return monitors; } -void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor) -{ -} - GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) { GLFWvidmode* result;