fixed segfault if pipeline returned an empty texture

This commit is contained in:
itsmattkc
2019-12-11 13:54:19 +11:00
parent 3d3e40d431
commit da98793a6b
+7 -1
View File
@@ -167,7 +167,13 @@ void OpenGLBackend::ThreadCompletedFrame(NodeDependency path, QByteArray hash, N
// Check if this frame has changed once again, in which case we may not want to draw it (it'll look jittery to the user)
if (!TimeIsQueued(TimeRange(path.in(), path.in()))) {
// FIXME: This texture is part of the texture cache and therefore volatile, we should probably copy it here instead
emit CachedFrameReady(path.in(), QVariant::fromValue(value.value<OpenGLTextureCache::ReferencePtr>()->texture()));
OpenGLTexturePtr tex = nullptr;
if (!value.isNull()) {
tex = value.value<OpenGLTextureCache::ReferencePtr>()->texture();
}
emit CachedFrameReady(path.in(), QVariant::fromValue(tex));
}
// Queue up a new frame for this worker