free the allocated import
parent
f0fca826db
commit
d51c2e6435
|
@ -96,6 +96,8 @@ namespace Assimp
|
||||||
/** will return all registered importers. */
|
/** will return all registered importers. */
|
||||||
void GetImporterInstanceList(std::vector< BaseImporter* >& out);
|
void GetImporterInstanceList(std::vector< BaseImporter* >& out);
|
||||||
|
|
||||||
|
/** will delete all registered importers. */
|
||||||
|
void DeleteImporterInstanceList(std::vector< BaseImporter* >& out);
|
||||||
} // namespace assimp
|
} // namespace assimp
|
||||||
|
|
||||||
|
|
||||||
|
@ -648,6 +650,8 @@ ASSIMP_API C_STRUCT const aiImporterDesc* aiGetImporterDesc( const char *extensi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeleteImporterInstanceList(out);
|
||||||
|
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,8 @@ using namespace Assimp::Formatter;
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
// ImporterRegistry.cpp
|
// ImporterRegistry.cpp
|
||||||
void GetImporterInstanceList(std::vector< BaseImporter* >& out);
|
void GetImporterInstanceList(std::vector< BaseImporter* >& out);
|
||||||
|
void DeleteImporterInstanceList(std::vector< BaseImporter* >& out);
|
||||||
|
|
||||||
// PostStepRegistry.cpp
|
// PostStepRegistry.cpp
|
||||||
void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out);
|
void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out);
|
||||||
}
|
}
|
||||||
|
@ -173,8 +175,7 @@ Importer::Importer()
|
||||||
Importer::~Importer()
|
Importer::~Importer()
|
||||||
{
|
{
|
||||||
// Delete all import plugins
|
// Delete all import plugins
|
||||||
for( unsigned int a = 0; a < pimpl->mImporter.size(); a++)
|
DeleteImporterInstanceList(pimpl->mImporter);
|
||||||
delete pimpl->mImporter[a];
|
|
||||||
|
|
||||||
// Delete all post-processing plug-ins
|
// Delete all post-processing plug-ins
|
||||||
for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++)
|
for( unsigned int a = 0; a < pimpl->mPostProcessingSteps.size(); a++)
|
||||||
|
@ -1113,4 +1114,3 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const
|
||||||
}
|
}
|
||||||
in.total += in.materials;
|
in.total += in.materials;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -321,4 +321,12 @@ void GetImporterInstanceList(std::vector< BaseImporter* >& out)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** will delete all registered importers. */
|
||||||
|
void DeleteImporterInstanceList(std::vector< BaseImporter* >& deleteList){
|
||||||
|
for(size_t i= 0; i<deleteList.size();++i){
|
||||||
|
delete deleteList[i];
|
||||||
|
deleteList[i]=NULL;
|
||||||
|
}//for
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Assimp
|
} // namespace Assimp
|
||||||
|
|
Loading…
Reference in New Issue