From 1bcfae5fd7e726cf6411c7a1bc5cf507d3406eca Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 3 Jan 2016 15:12:46 -0500 Subject: [PATCH] OGL: Correct unique_ptr types By default unique_ptr will call delete on the given type if an array qualifier isn't present, not delete[]. It's important to explicitly specify an array is being handled. --- Source/Core/VideoBackends/OGL/Render.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index b94138fc59..254f5caf03 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -848,7 +848,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) g_renderer->RestoreAPIState(); } - std::unique_ptr depthMap(new float[targetPixelRcWidth * targetPixelRcHeight]); + std::unique_ptr depthMap(new float[targetPixelRcWidth * targetPixelRcHeight]); glReadPixels(targetPixelRc.left, targetPixelRc.bottom, targetPixelRcWidth, targetPixelRcHeight, GL_DEPTH_COMPONENT, GL_FLOAT, depthMap.get()); @@ -887,7 +887,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) g_renderer->RestoreAPIState(); } - std::unique_ptr colorMap(new u32[targetPixelRcWidth * targetPixelRcHeight]); + std::unique_ptr colorMap(new u32[targetPixelRcWidth * targetPixelRcHeight]); if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3) // XXX: Swap colours