2
0
Эх сурвалжийг харах

Merge pull request #1887 from assimp/develop_kimkulling

add missing constructor to ensure RTTI
Kim Kulling 7 жил өмнө
parent
commit
6a0dc071a9
2 өөрчлөгдсөн 25 нэмэгдсэн , 10 устгасан
  1. 1 4
      code/Importer.cpp
  2. 24 6
      code/Importer.h

+ 1 - 4
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 = "";
 

+ 24 - 6
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<KeyType, std::string> StringPropertyMap;
     typedef std::map<KeyType, aiMatrix4x4> 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