Merge pull request #3540 from wasd845/master

_dest may be destructed twice if _dest is not null in MergeScenes()
pull/3555/head
Kim Kulling 2020-12-22 12:07:01 +01:00 committed by GitHub
commit 102d380711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -183,9 +183,10 @@ void SceneCombiner::MergeScenes(aiScene **_dest, std::vector<aiScene *> &src, un
*_dest = src[0];
return;
}
if (*_dest)
if (*_dest) {
(*_dest)->~aiScene();
else
new (*_dest) aiScene();
} else
*_dest = new aiScene();
// Create a dummy scene to serve as master for the others