From c72a5f36050354526bbfc138de1e8694c7a27bc9 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Mon, 11 Apr 2016 16:32:32 -0700 Subject: [PATCH] Exit cleanly in debug with GL logger --- libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp | 4 +++- libraries/gpu/src/gpu/GLBackendTextureTransfer.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp b/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp index f60c8b5b39..45b7f9f57a 100644 --- a/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp +++ b/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp @@ -36,7 +36,7 @@ using namespace gpu; GLTextureTransferHelper::GLTextureTransferHelper() { #ifdef THREADED_TEXTURE_TRANSFER - _canvas = std::make_shared(); + _canvas = QSharedPointer(new OffscreenGLCanvas(), &QObject::deleteLater); _canvas->create(QOpenGLContextWrapper::currentContext()); if (!_canvas->makeCurrent()) { qFatal("Unable to create texture transfer context"); @@ -89,9 +89,11 @@ void GLTextureTransferHelper::setup() { } void GLTextureTransferHelper::shutdown() { +#ifdef THREADED_TEXTURE_TRANSFER _canvas->doneCurrent(); _canvas->moveToThreadWithContext(qApp->thread()); _canvas.reset(); +#endif } diff --git a/libraries/gpu/src/gpu/GLBackendTextureTransfer.h b/libraries/gpu/src/gpu/GLBackendTextureTransfer.h index a3fae74213..1046fc9883 100644 --- a/libraries/gpu/src/gpu/GLBackendTextureTransfer.h +++ b/libraries/gpu/src/gpu/GLBackendTextureTransfer.h @@ -6,6 +6,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include #include #include "GLBackendShared.h" @@ -34,7 +35,7 @@ protected: void transferTextureSynchronous(const gpu::Texture& texture); private: - std::shared_ptr _canvas; + QSharedPointer _canvas; }; template