Merge pull request #1887 from assimp/develop_kimkulling

add missing constructor to ensure RTTI
pull/1895/head
Kim Kulling 2018-04-08 23:59:21 +02:00 committed by GitHub
commit 6a0dc071a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 10 deletions

View File

@ -147,10 +147,7 @@ void AllocateFromAssimpHeap::operator delete[] ( void* data) {
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Importer constructor. // Importer constructor.
Importer::Importer() Importer::Importer()
: pimpl( NULL ) { : pimpl( new ImporterPimpl ) {
// allocate the pimpl first
pimpl = new ImporterPimpl();
pimpl->mScene = NULL; pimpl->mScene = NULL;
pimpl->mErrorString = ""; pimpl->mErrorString = "";

View File

@ -68,10 +68,8 @@ namespace Assimp {
* std::vector and std::map in the public headers. Furthermore we are dropping * std::vector and std::map in the public headers. Furthermore we are dropping
* any STL interface problems caused by mismatching STL settings. All * any STL interface problems caused by mismatching STL settings. All
* size calculation are now done by us, not the app heap. */ * size calculation are now done by us, not the app heap. */
class ImporterPimpl class ImporterPimpl {
{
public: public:
// Data type to store the key hash // Data type to store the key hash
typedef unsigned int KeyType; typedef unsigned int KeyType;
@ -82,8 +80,6 @@ public:
typedef std::map<KeyType, std::string> StringPropertyMap; typedef std::map<KeyType, std::string> StringPropertyMap;
typedef std::map<KeyType, aiMatrix4x4> MatrixPropertyMap; typedef std::map<KeyType, aiMatrix4x4> MatrixPropertyMap;
public:
/** IO handler to use for all file accesses. */ /** IO handler to use for all file accesses. */
IOSystem* mIOHandler; IOSystem* mIOHandler;
bool mIsDefaultHandler; bool mIsDefaultHandler;
@ -117,12 +113,34 @@ public:
MatrixPropertyMap mMatrixProperties; MatrixPropertyMap mMatrixProperties;
/** Used for testing - extra verbose mode causes the ValidateDataStructure-Step /** 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; bool bExtraVerbose;
/** Used by post-process steps to share data */ /** Used by post-process steps to share data */
SharedPostProcessInfo* mPPShared; 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 //! @endcond