Merge pull request #3755 from assimp/kimkulling-issue3754

Not resize empty vectors.
pull/3758/head
Kim Kulling 2021-04-12 23:31:06 +02:00 committed by GitHub
commit 182418e818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
/// @brief Will find a node by its name.
struct find_node_by_name_predicate {
std::string mName;
find_node_by_name_predicate(const std::string &name) :
@ -88,7 +89,11 @@ public:
}
void clear() {
mData.resize(0);
if(mData.empty()) {
mDoc = nullptr;
return;
}
mData.clear();
delete mDoc;
mDoc = nullptr;
}