Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread 1: EXC_BAD_ACCESS standard C memory issue fix #97

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AssimpKit/Code/Model/AssimpImporter.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ - (SCNNode *)makeSCNNodeFromAssimpNode:(const struct aiNode *)aiNode
node.name = [NSString stringWithUTF8String:aiNodeName->data];
DLog(@" Creating node %@ with %d meshes", node.name, aiNode->mNumMeshes);
int nVertices = [self findNumVerticesInNode:aiNode inScene:aiScene];
DLog(@" N VERTICES: %@", nVertices);
NSData *nVerticesData = [NSData dataWithBytes: &nVertices length: sizeof(nVertices)];
DLog(@" N VERTICES: %@", nVerticesData);
if (nVertices > 0)
{
node.geometry = [self makeSCNGeometryFromAssimpNode:aiNode
Expand Down Expand Up @@ -875,7 +876,7 @@ - (NSMutableArray *)makeMaterialsForNode:(const struct aiNode *)aiNode
aiGetMaterialString(aiMaterial, AI_MATKEY_NAME, &name);
NSString *nameString = [NSString stringWithUTF8String:
(const char *_Nonnull) & name.data];
DLog(@" Material name is %@", name);
DLog(@" Material name is %@", nameString);
SCNMaterial *material = [SCNMaterial material];
material.name = nameString;
int kTextureTypes = 10;
Expand Down