Don't hide out-of-memory during FBX import

pull/4801/head
Jan Krassnigg 2022-11-18 13:44:05 +01:00
parent 11fe77c446
commit 08f2f0f82f
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)); 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) { catch(std::exception& ex) {
flags &= ~BEING_CONSTRUCTED; flags &= ~BEING_CONSTRUCTED;
flags |= FAILED_TO_CONSTRUCT; flags |= FAILED_TO_CONSTRUCT;