From 4e9176d2cdadc094228a5a24a5716340e25192b5 Mon Sep 17 00:00:00 2001 From: wasd845 <845073947@qq.com> Date: Mon, 14 Dec 2020 19:16:29 +0800 Subject: [PATCH] _dest may be destructed twice if _dest is not null in MergeScenes() --- code/Common/SceneCombiner.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/Common/SceneCombiner.cpp b/code/Common/SceneCombiner.cpp index bfc4899a1..193586a7c 100644 --- a/code/Common/SceneCombiner.cpp +++ b/code/Common/SceneCombiner.cpp @@ -183,9 +183,10 @@ void SceneCombiner::MergeScenes(aiScene **_dest, std::vector &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