Revamp exception handling. ImportErrorException renamed to DeadlyImportError to avoid silent regressions. Exceptions now thrown by value, and caught by reference. Put guards in all C++ and C API functions to avoid unwanted exception propagation across module and language boundaries.
PLEASE TEST CAREFULLY IF THIS SHOULD CAUSE REGRESSIONS. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@617 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -96,7 +96,7 @@ void OFFImporter::InternReadFile( const std::string& pFile,
|
||||
|
||||
// Check whether we can read from the file
|
||||
if( file.get() == NULL) {
|
||||
throw new ImportErrorException( "Failed to open OFF file " + pFile + ".");
|
||||
throw DeadlyImportError( "Failed to open OFF file " + pFile + ".");
|
||||
}
|
||||
|
||||
// allocate storage and copy the contents of the file to a memory buffer
|
||||
@@ -158,7 +158,7 @@ void OFFImporter::InternReadFile( const std::string& pFile,
|
||||
}
|
||||
|
||||
if (!mesh->mNumVertices)
|
||||
throw new ImportErrorException("OFF: There are no valid faces");
|
||||
throw DeadlyImportError("OFF: There are no valid faces");
|
||||
|
||||
// allocate storage for the output vertices
|
||||
aiVector3D* verts = mesh->mVertices = new aiVector3D[mesh->mNumVertices];
|
||||
|
||||
Reference in New Issue
Block a user