Fix: Fix leak in Scope class, FBX
- closes https://github.com/assimp/assimp/issues/3421pull/5067/head
parent
333f7d5ee0
commit
ca937788ee
|
@ -188,15 +188,19 @@ Scope::Scope(Parser& parser,bool topLevel)
|
|||
ParseError("unexpected content: empty string.");
|
||||
}
|
||||
|
||||
elements.insert(ElementMap::value_type(str,new_Element(*n,parser)));
|
||||
auto *element = new_Element(*n, parser);
|
||||
|
||||
// Element() should stop at the next Key token (or right after a Close token)
|
||||
n = parser.CurrentToken();
|
||||
if (n == nullptr) {
|
||||
if (topLevel) {
|
||||
elements.insert(ElementMap::value_type(str, element));
|
||||
return;
|
||||
}
|
||||
ParseError("unexpected end of file",parser.LastToken());
|
||||
delete element;
|
||||
} else {
|
||||
elements.insert(ElementMap::value_type(str, element));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue