mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
GeometryReader: We should delete the fbxGeometry if we've lost the resource.
This commit is contained in:
parent
865a77ae20
commit
07cfa13a82
1 changed files with 3 additions and 2 deletions
|
@ -144,10 +144,11 @@ void GeometryReader::run() {
|
||||||
throw QString("unsupported format");
|
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();
|
auto resource = _resource.toStrongRef();
|
||||||
if (!resource) {
|
if (!resource) {
|
||||||
qCWarning(modelnetworking) << "Abandoning load of" << _url << "; could not get strong ref";
|
qCWarning(modelnetworking) << "Abandoning load of" << _url << "; could not get strong ref";
|
||||||
|
delete fbxGeometry;
|
||||||
} else {
|
} else {
|
||||||
QMetaObject::invokeMethod(resource.data(), "setGeometryDefinition", Qt::BlockingQueuedConnection, Q_ARG(void*, fbxGeometry));
|
QMetaObject::invokeMethod(resource.data(), "setGeometryDefinition", Qt::BlockingQueuedConnection, Q_ARG(void*, fbxGeometry));
|
||||||
}
|
}
|
||||||
|
@ -159,7 +160,7 @@ void GeometryReader::run() {
|
||||||
qCDebug(modelnetworking) << "Error reading " << _url << ": " << error;
|
qCDebug(modelnetworking) << "Error reading " << _url << ": " << error;
|
||||||
|
|
||||||
auto resource = _resource.toStrongRef();
|
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) {
|
if (!resource) {
|
||||||
qCWarning(modelnetworking) << "Abandoning load of" << _url << "; could not get strong ref";
|
qCWarning(modelnetworking) << "Abandoning load of" << _url << "; could not get strong ref";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue