Merge branch 'master' into refactor/KHR_material_specular

pull/4786/head
Adam Beili 2022-11-19 17:40:22 +02:00 committed by GitHub
commit 5441f07d05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -199,6 +199,14 @@ const Object* LazyObject::Get(bool dieOnError) {
object.reset(new AnimationCurveNode(id,element,name,doc));
}
}
catch (std::bad_alloc&) {
// out-of-memory is unrecoverable and should always lead to a failure
flags &= ~BEING_CONSTRUCTED;
flags |= FAILED_TO_CONSTRUCT;
throw;
}
catch(std::exception& ex) {
flags &= ~BEING_CONSTRUCTED;
flags |= FAILED_TO_CONSTRUCT;