From 07cfa13a8249599f483c432eec06ec440eec2795 Mon Sep 17 00:00:00 2001 From: Anthony Thibault Date: Sun, 3 Apr 2016 09:23:53 -0700 Subject: [PATCH] GeometryReader: We should delete the fbxGeometry if we've lost the resource. --- .../model-networking/src/model-networking/ModelCache.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp index 9b5acc726e..c8fe82abb4 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.cpp +++ b/libraries/model-networking/src/model-networking/ModelCache.cpp @@ -144,10 +144,11 @@ void GeometryReader::run() { throw QString("unsupported format"); } - // Ensure the resource has not been deleted, and won't be while invoke method is in flight. + // Ensure the resource has not been deleted, and won't be while invokeMethod is in flight. auto resource = _resource.toStrongRef(); if (!resource) { qCWarning(modelnetworking) << "Abandoning load of" << _url << "; could not get strong ref"; + delete fbxGeometry; } else { QMetaObject::invokeMethod(resource.data(), "setGeometryDefinition", Qt::BlockingQueuedConnection, Q_ARG(void*, fbxGeometry)); } @@ -159,7 +160,7 @@ void GeometryReader::run() { qCDebug(modelnetworking) << "Error reading " << _url << ": " << error; auto resource = _resource.toStrongRef(); - // Ensure the resoruce has not been deleted, and won't be while invoke method is in flight. + // Ensure the resoruce has not been deleted, and won't be while invokeMethod is in flight. if (!resource) { qCWarning(modelnetworking) << "Abandoning load of" << _url << "; could not get strong ref"; } else {