From da6e3991611ee3c8d80bc097e6a4e4c0b2b8dda6 Mon Sep 17 00:00:00 2001 From: sam gateau Date: Tue, 2 Oct 2018 17:15:07 -0700 Subject: [PATCH] INtroduce a safe destruction of the TBO defined when using a gpu::Buffer as REsourceBuffer in gl41 backend --- libraries/gpu-gl/src/gpu/gl41/GL41BackendBuffer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/gpu-gl/src/gpu/gl41/GL41BackendBuffer.cpp b/libraries/gpu-gl/src/gpu/gl41/GL41BackendBuffer.cpp index d5193f892a..d6add03c4f 100644 --- a/libraries/gpu-gl/src/gpu/gl41/GL41BackendBuffer.cpp +++ b/libraries/gpu-gl/src/gpu/gl41/GL41BackendBuffer.cpp @@ -20,7 +20,10 @@ namespace gpu { ~GL41Buffer() { if (_texBuffer) { - glDeleteTextures(1, &_texBuffer); + auto backend = _backend.lock(); + if (backend) { + backend->releaseTexture(_texBuffer, 0); + } } }