diff --git a/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp b/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp index 2610d9bc4a..907bc6a538 100644 --- a/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp +++ b/libraries/gpu/src/gpu/GLBackendTextureTransfer.cpp @@ -77,6 +77,12 @@ void GLTextureTransferHelper::setup() { #endif } +void GLTextureTransferHelper::shutdown() { + _canvas->doneCurrent(); + _canvas->moveToThreadWithContext(qApp->thread()); +} + + bool GLTextureTransferHelper::processQueueItems(const Queue& messages) { for (auto package : messages) { glWaitSync(package.fence, 0, GL_TIMEOUT_IGNORED); diff --git a/libraries/gpu/src/gpu/GLBackendTextureTransfer.h b/libraries/gpu/src/gpu/GLBackendTextureTransfer.h index 3a147defdf..1e850586d4 100644 --- a/libraries/gpu/src/gpu/GLBackendTextureTransfer.h +++ b/libraries/gpu/src/gpu/GLBackendTextureTransfer.h @@ -28,6 +28,7 @@ public: protected: void setup() override; + void shutdown() override; bool processQueueItems(const Queue& messages) override; void transferTextureSynchronous(const gpu::Texture& texture);