Fix coverity findings: fix possible usage after calling free.
parent
a66e644bf3
commit
238f14f30f
|
@ -93,11 +93,11 @@ glTFExporter::glTFExporter(const char* filename, IOSystem* pIOSystem, const aiSc
|
||||||
, mScene(pScene)
|
, mScene(pScene)
|
||||||
, mProperties(pProperties)
|
, mProperties(pProperties)
|
||||||
{
|
{
|
||||||
std::unique_ptr<Asset> asset(new glTF::Asset(pIOSystem));
|
std::unique_ptr<Asset> asset();
|
||||||
mAsset = asset.get();
|
mAsset.reset( new glTF::Asset( pIOSystem ) );
|
||||||
|
|
||||||
if (isBinary) {
|
if (isBinary) {
|
||||||
asset->SetAsBinary();
|
mAsset->SetAsBinary();
|
||||||
}
|
}
|
||||||
|
|
||||||
ExportMetadata();
|
ExportMetadata();
|
||||||
|
|
|
@ -46,13 +46,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <assimp/types.h>
|
#include <assimp/types.h>
|
||||||
#include <assimp/material.h>
|
#include <assimp/material.h>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
struct aiScene;
|
struct aiScene;
|
||||||
struct aiNode;
|
struct aiNode;
|
||||||
struct aiMaterial;
|
struct aiMaterial;
|
||||||
|
@ -89,7 +88,7 @@ namespace Assimp
|
||||||
|
|
||||||
std::map<std::string, unsigned int> mTexturesByPath;
|
std::map<std::string, unsigned int> mTexturesByPath;
|
||||||
|
|
||||||
glTF::Asset* mAsset;
|
std::shared_ptr<glTF::Asset> mAsset;
|
||||||
|
|
||||||
std::vector<unsigned char> mBodyData;
|
std::vector<unsigned char> mBodyData;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue