From e352fa78ba3559b053a6723e8c377c169ac29809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 9 Jun 2020 21:10:48 +0200 Subject: [PATCH] Platform: allocate only for how many EGL devices there is. --- src/Magnum/Platform/WindowlessEglApplication.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Magnum/Platform/WindowlessEglApplication.cpp b/src/Magnum/Platform/WindowlessEglApplication.cpp index bd2a1622c..01a2a0307 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.cpp +++ b/src/Magnum/Platform/WindowlessEglApplication.cpp @@ -73,8 +73,6 @@ namespace Magnum { namespace Platform { #ifndef MAGNUM_TARGET_WEBGL namespace { -static constexpr UnsignedInt MaxEGLDevices = 128; - bool extensionSupported(const char* const extensions, Containers::ArrayView extension) { CORRADE_INTERNAL_ASSERT(extensions); const char* pos = std::strstr(extensions, extension); @@ -170,7 +168,7 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G return; } - devices = Containers::Array{MaxEGLDevices}; + devices = Containers::Array{std::size_t(count)}; /* Assuming the same thing won't suddenly start failing when called the second time */ CORRADE_INTERNAL_ASSERT_OUTPUT(eglQueryDevices(devices.size(), devices, &count));