From c41d459e212d151c37d2eccc5b43e63cd4bac349 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 8 Apr 2018 21:27:18 +0200 Subject: [PATCH] add missing constructor to ensure RTTI --- code/Importer.cpp | 5 +---- code/Importer.h | 30 ++++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/code/Importer.cpp b/code/Importer.cpp index 6422ca6d0..6f9b47562 100644 --- a/code/Importer.cpp +++ b/code/Importer.cpp @@ -147,10 +147,7 @@ void AllocateFromAssimpHeap::operator delete[] ( void* data) { // ------------------------------------------------------------------------------------------------ // Importer constructor. Importer::Importer() - : pimpl( NULL ) { - // allocate the pimpl first - pimpl = new ImporterPimpl(); - + : pimpl( new ImporterPimpl ) { pimpl->mScene = NULL; pimpl->mErrorString = ""; diff --git a/code/Importer.h b/code/Importer.h index d15df2f85..870638631 100644 --- a/code/Importer.h +++ b/code/Importer.h @@ -68,10 +68,8 @@ namespace Assimp { * std::vector and std::map in the public headers. Furthermore we are dropping * any STL interface problems caused by mismatching STL settings. All * size calculation are now done by us, not the app heap. */ -class ImporterPimpl -{ +class ImporterPimpl { public: - // Data type to store the key hash typedef unsigned int KeyType; @@ -82,8 +80,6 @@ public: typedef std::map StringPropertyMap; typedef std::map MatrixPropertyMap; -public: - /** IO handler to use for all file accesses. */ IOSystem* mIOHandler; bool mIsDefaultHandler; @@ -117,12 +113,34 @@ public: MatrixPropertyMap mMatrixProperties; /** Used for testing - extra verbose mode causes the ValidateDataStructure-Step - * to be executed before and after every single postprocess step */ + * to be executed before and after every single post-process step */ bool bExtraVerbose; /** Used by post-process steps to share data */ SharedPostProcessInfo* mPPShared; + + /// The default class constructor. + ImporterPimpl(); }; + +inline +ImporterPimpl::ImporterPimpl() +: mIOHandler( nullptr ) +, mIsDefaultHandler( false ) +, mProgressHandler( nullptr ) +, mIsDefaultProgressHandler( false ) +, mImporter() +, mPostProcessingSteps() +, mScene( nullptr ) +, mErrorString() +, mIntProperties() +, mFloatProperties() +, mStringProperties() +, mMatrixProperties() +, bExtraVerbose( false ) +, mPPShared( nullptr ) { + // empty +} //! @endcond