diff --git a/app/render/backend/opengl/opengltexturecache.cpp b/app/render/backend/opengl/opengltexturecache.cpp index c5d20c044..30919db98 100644 --- a/app/render/backend/opengl/opengltexturecache.cpp +++ b/app/render/backend/opengl/opengltexturecache.cpp @@ -26,8 +26,6 @@ OpenGLTextureCache::ReferencePtr OpenGLTextureCache::Get(QOpenGLContext* ctx, co } } - lock_.unlock(); - // If we didn't find a texture, we'll need to create one if (!texture) { texture = std::make_shared(); @@ -38,6 +36,9 @@ OpenGLTextureCache::ReferencePtr OpenGLTextureCache::Get(QOpenGLContext* ctx, co ReferencePtr ref = std::make_shared(this, texture); existing_references_.append(ref.get()); + + lock_.unlock(); + return ref; }